# HG changeset patch # User paulb # Date 1121990716 0 # Node ID 28b1e6a409c8d9ad1c15d2f1260cd9bad856ca23 # Parent b56954a07123977a87c43657af7f92697dcb02d9 [project @ 2005-07-22 00:05:16 by paulb] Added note about mixing element collections with other elements and the potential side-effects of doing so. diff -r b56954a07123 -r 28b1e6a409c8 docs/advice.html --- a/docs/advice.html Thu Jul 21 23:54:49 2005 +0000 +++ b/docs/advice.html Fri Jul 22 00:05:16 2005 +0000 @@ -22,9 +22,26 @@ at a different position depending on how many such values have been inserted. Whilst this might not affect some applications, at least not to begin with, the usage of more advanced features (selectors, for example) will probably expose + href="in-page-updates.html">in-page updates, for example) will +probably expose problems due to the way XSLForms reconstructs the XML document data from the input form data.

+

Beware of Adding Elements into Mixtures of Elements

+

Although we ignore this rule with the example in this documentation, +it is necessary to be aware of problems with adding and removing +elements where other elements may reside. Consider part of our form +data structure:

+
<item value="a">
<type>
<type-enum value="1"/>
</type>
<subitem value="x"/>
</item>
+

Provided that we control the process of adding and removing the +elements, making sure that they always reside at the end of the element +collection inside the item element, and that they +always follow a known number of elements, we can avoid issues with more +advanced features (in-page updates, +for example), although using such features on the subitem +elements themselves may cause problems that may only be resolved by +moving the subitem elements into a container element +of their own:

+
<item value="a">
<type>
<type-enum value="1"/>
</type>
<subitems>
<subitem value="x"/>
</subitems>
</item>

Make Sure the Output Structure Agrees with the Template