[XML-SIG] A Q About DOCTYPE manipulation

Martin v. Loewis martin@v.loewis.de
11 Feb 2002 13:22:11 +0100

"Mariappan, MaharajanX" <m_mariappanX@trillium.com> writes:

> I'm using minidom to parse the xml file. I'm unable to specify a line like
> this
> <!DOCTYPE Product SYSTEM "master_test.dtd">
> in the XML file i'm creating.

Can you please be a bit more specific? What is the problem with
writing this line into the XML file?

> Also the for the DocumentType Objects i'm unable to get or set the publicId
> (master_test.dtd??)
> How do I set the SYSTEM attribute so that i can point it to a dtd file?
> Also after creating the xml object when i make a call to "toxml()" the
> DocumentType is not printed?
> How can i parse the publicID and write it using minidom (dtd value)?

The DTD support in DOM is very limited, and it also may be that there
are bugs in PyXML; you'ld have to provide a specific test case, and
somebody would need to check this against the specs to determine
whether it is a limitation in the specs or in the implementation.

In any case, if you need the DOCTYPE declaration on output, I
recommend to integrate with writexml, and to write out the DOCTYPE
declaration explicitly.