[XML-SIG] Dissabling DTDs or arranging the Attribute order

Reza Naima Reza Naima <reza@reza.net>
Mon, 4 Dec 2000 15:40:56 -0800


I'm using PyXML to parse an XML document, modify it, and spit it back
out.  I'm having a lame problem.  It seems as if this third-party
software is not working properly, and I need to work around it.  Their
problem is that they have an element that looks like

<element attribute1='false' attribute2='false' attribute3='false'>

well, after I parse it, I will occasionally change the attribute1 to be
'true'.  after generating the XML from the DOM, It prints it out like
this :

<element attribute2='false' attribute3='false' attribute1='true'>

Now, the 3rd party software is broken and rather than looking for
attribute1, it just assumes that attribute1 is the first attribute, and
mistakenly reads it as 'false'.  (it's actually attribute2 that it's
reading).

Now, there are to work-arounds... First off, would there be a way for me
to guarantee that attribute1 is first on the list of attributes for that
element. 

The other work-around is to get rid of attribute2 and attribute3.  This
workes, but it seems as PyXML looks at the DTD spec, notices that they
are missing, and fills them in.  So, I'de like to find a way to get
PyXML to ignore the DTD.

Are either of these options possible?  I've started going through the
source, but it's getting uglier and uglier..

Thanks,
Reza