[xsd-users] Preserving XML element order

Barrie Kovish barrie.kovish at singularsoftware.com
Sat Feb 13 13:31:30 EST 2010


Boris,

At this point I don't know all the details related to the insertions.  I know that in one case we need to insert complex elements to a series of similar elements.  Likely in the future we would need to do the same plus perform some sort of fix up of other elements which were dependent upon the element order.  For example

Starting XML:
<A>x</A>  <!-- implicit index 1-->
<A>y</A>  <!-- implicit index 2-->
<A>z</A>  <!-- implicit index 3-->

Changed XML:
<A>x</A>  <!-- implicit index 1-->
<A>y</A>  <!-- implicit index 2-->
<A>u</A>  <!-- implicit index 3-->
<A>z</A>  <!-- implicit index 4-->

Other elements in the file will contain the 1, 2, and 3.  We will need to fix them up to have the new and correct indices.  The contents x,y,z, u can also be complex or simple elements.

Barrie

On 2010-02-12, at 9:48 AM, Boris Kolpackov wrote:

> Hi Barrie,
> 
> Barrie Kovish <barrie.kovish at singularsoftware.com> writes:
> 
>> We do need to add nodes to the tree so the last option appears to be 
>> out.
> 
> Yes, that complicates things. What kind of node insertion would you
> need to perform? Just appending them at the end of the existing nodes 
> or inserting them at specific positions?
> 
> Also, will it be possible for you to send me your schema (in a private
> email) so that I could take a closer look?
> 
> 
>> I had a look at XSD/e and it looks like it won't support XPATH queries 
>> which is also a significant limitation for us.
> 
> No, there is no XPath support in XSD/e.
> 
> 
>> Currently I am investigating using Xerxes.  This presents a much more 
>> complex programming model so is not appealing!
> 
> Yes, using raw DOM is always an option though not a very convenient one.
> Let's see if we can figure out a way.
> 
> Boris




More information about the xsd-users mailing list