You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Hellmann Peter (ext)" <Pe...@mch.siemens.de> on 2002/11/07 09:20:05 UTC

right-sequencing child nodes

hi all,

please allow me one question. because no validation occurs while adding
nodes to a dom tree (no dynamic validation) i can add some child nodes to my
dom tree in the wrong sequence (DTD says <tag1> must come before <tag2> but
i can add nodes in an arbitrary order). Because when serializing, no
validation is done, my unmarshalled output contains the tags in the wrong
sequence. now my question is if there is any function that does
right-sequencing child nodes according to the settings in the DTD prior to
serialization?

thanx 4 any hints

kind regards
Peter Brightman



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: right-sequencing child nodes

Posted by Joseph Kesselman <ke...@us.ibm.com>.
Serialization should be outputting the nodes in document order. If 
anything else is happening, that's a bug either in how you're constructing 
the document or how the serializer is working.

EXCEPTION: Attributes within a single element, by definition, are 
unordered. You can't control their order, parsers and serializers are not 
guaranteed to preserve their order, and no application should ever attempt 
to consider their order significant.

______________________________________
Joe Kesselman  / IBM Research

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org