Re: [xml] Ordering of attributes: xmlGetDtdElementDesc()



On 11Feb, Daniel Veillard wrote:
On Tue, Feb 11, 2003 at 09:54:34AM -0800, Mark S Petrovic wrote:
Given

dtdPtr DTD;
xmlChar *N;
xmlElementPtr E;
xmlAttributePtr A;

   E = xmlGetDtdElementDesc(DTD,N);
   A = E->attributes;

is the list of attributes A ordered exactly as those same attributes
are ordered in the DTD for the element named N?

  No, because there is no such ordering !

I believe you mean that the ordering is not significant because there
are many logically equivalent representations of an XML document.
Fair enough.  You are therefore free to tell me that further questions
on this have no meaning.

But ---  being a glutton for punishment, the list, in fact has some
order for a given instance of the thing pointed to by dtdPtr DTD.
Is this order something you might comment on?  If not, I understand.

In general there is no attribute ordering in XML.
For attribute declarations, some may be done in the internal subset or
the external subset, and possibly in different ATTLIST declarations in
both, so basically there is no order in the DTD either.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]