xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Greif" <jgr...@alumni.princeton.edu>
Subject Re: right-sequencing of child tags in dom
Date Thu, 07 Nov 2002 14:39:38 GMT
With the tools I've used, the best you can do is to try to validate your
DOM, and fix it up yourself if validation fails.  Validating the DOM can
either be done using the Xerces 2 DOM Level 3 Validation stuff, or by
serializing the DOM and reparsing.  If you use the DOM Level 3 validation
interfaces, you can validate on each edit of the DOM, thus avoiding the
ordering problem.

While it is true that for any valid instance of any valid DTD content model,
there is an unambiguous assignment of elements of the instance to items in
the content model, ambiguity appears if you allow rearrangements of the
order of children.  If at each node in the DOM you allow arbitrary
reorderings of the children in order to match the content model, there will
be cases where more than one correct solution is possible (perhaps a huge
number).  You would either have to have the algorithm choose the first one
that worked, or present you with all of them to pick from.

Jeff
----- Original Message -----
From: "Hellmann Peter (ext)" <Peter.Hellmann@mch.siemens.de>
To: "Xerces (E-Mail)" <xerces-j-user@xml.apache.org>
Sent: Wednesday, November 06, 2002 9:14 AM
Subject: right-sequencing of child tags in dom


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?


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


Mime
View raw message