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

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 5 Dec 2000 01:11:50 +0100


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

That shouldn't be hard to achieve if you use the xml.dom.ext.Printer
framework - just subclass the PrintVisitor (or the PrettyPrintVisitor)
and replace the visitNameNodeMap method. That iterates over the
attributes in the order they have in the dictionary; you could sort
them (lexically) before that.

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

I'm surprised it looks into the DTD. During parsing, you mean? Then
you probably use xmlproc as the parser, which is validating. If you'd
use pyexpat (or some other non-validating parser), it couldn't
possibly use the DTD.

Regards,
Martin