xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hellmann Peter (ext)" <Peter.Hellm...@mch.siemens.de>
Subject AW: right-sequencing of child tags in dom
Date Thu, 07 Nov 2002 16:51:50 GMT
thanks for all the comments on this topic.

> -----Urspr√ľngliche Nachricht-----
> Von: Joseph Kesselman [mailto:keshlam@us.ibm.com]
> Gesendet: Donnerstag, 7. November 2002 16:01
> An: xerces-j-user@xml.apache.org
> Betreff: Re: right-sequencing of child tags in dom
> 
> 
> ... My apologies; I think I misread the question.
> 
> If by "right sequence" you mean "to conform with a specific 
> DTD or schema"
yes right. because the serializer would output xml that would not validate
correct if you'd rebuild a dom tree with the output. this is because if you
add a child node to a parent node, the child nodes added will be ordered
chronologically and not in the DTD conform order. in my case a simple
ordering by tag-name would do the job but - oops - there is no OQL or SQL
integrated into the dom. 
> -- there's no standard API yet that will help you with this. The DOM 
> Working Group is still interested in addressing this, but 
> they changed 
> their approach a while back and I'm not sure what state that effort's 
> currently in. Xerces has some custom APIs which allow accessing the 
> schema, but I haven't used them enough to advise you on 
> whether they'd 
> give you all the information you need.
ok, thank you anyway.
> 
> I agree with the point that automatically reordering would 
> risk breaking 
> the user's intent. It's probably better to generate a 
> validly-structured 
> tree in the first place, under the guidance of information 
> retrieved from 
> the schema, and to provide tools to check validity.
but the xml will not be validated against the user's intent but against the
DTD, so in my opinion adding child nodes unordered/chronologically and
before serializing ordering it DTD conform would be a great help. because in
my application there is a GUI whereby a user can add information in an
arbitrary way, to give it the most flexability, one can understand that i
don't want to confrontate my user with a DTD. but of course i can do the
ordering of my child elements by myself, well, i'll have to do.
> 
> Sometimes the simplest answer is to hard-code knowledge of 
> the specific 
> document's structure into your application, so the children 
> *have* to be 
> generated in the right order.
yes, i'll have to do the job. still i believe it would be a nice job if a
validator could heal wrong ordered or wild mixed child tags DTD conform. i
love intelligent automatisms, i love auto correction and i do not love
errors and manual work.

cheers,

Peter

> 
> ______________________________________
> 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
> 

---------------------------------------------------------------------
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