[XML-SIG] 0.5.4 and documentType

Uche Ogbuji uogbuji@fourthought.com
Wed, 31 May 2000 10:29:16 -0600


> * Jarek Wilkiewicz
> | 
> | I tried creating a DOM tree from an xml file, and the
> | document.documentType returns a None. Is implementation of the
> | DocumentType missing from the current PyXML release, or am I doing
> | something wrong?
> 
> The problem is that SAX, which PyDOM uses to read in the document,
> does not report the DOCTYPE declaration, and so PyDOM can't include it
> in the document. 4DOM has the same problem.
> 
> SAX 2.0 will include this, and it's possible that 4DOM takes advantage
> of that in it's Sax2 reader, but I haven't been able to look at that
> yet.

This is exactly right.  Use

xml.dom.ext.readers.Sax2 and you'll get your doctyupe just fine.  This is not 
upgraded to the latest XML-SIG SAX2 yet, but will be soon.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +01 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python