[XML-SIG] problem in ElementTree SubElement
dkgunter at lbl.gov
Wed Feb 8 05:13:49 CET 2006
Right, in general XML processors don't care about attribute order (I
don't know much about canonicalization but that does sound like the
obvious exception). The XML Infoset specifically says they are an
unordered set: http://www.w3.org/TR/xml-infoset/#infoitem.element ; so,
if you care about order, rather than canonicalizing everything, maybe
you should switch to using elements, e.g.
Radovan Chytracek wrote:
> you simply can't rely on the order of attributes unless your XML
>data are in canonical form which keeps attributes alphabetically
>ordered. I guess this a very simple way of saying that the SAX parser
>likely to be running behind ElementTree API layer does not preserve
>the order of attributes. In general SAX(2) does not have to. Please
>correct me if I am wrong about this.
>On 2/6/06, Sbaush <sbaush at gmail.com> wrote:
>>I would get this element in xml:
>><date month="02" day="06" />
>>I have write this:
>>but i get this:
>><date day="06" month="02" />
>>The attributes are not in my order!!
>>how i can get the attributes in right order???
>>XML-SIG maillist - XML-SIG at python.org
>Radovan Chytracek CERN IT PSS
>mailto:Radovan.Chytracek at cern.ch
>phone: +41227674578 fax: +41227669830
>XML-SIG maillist - XML-SIG at python.org
More information about the XML-SIG