pyXML beginner questions

Uche Ogbuji uche at ogbuji.net
Sun Mar 14 23:27:27 EST 2004


Sebastian Fey <fey at parsytec.de> wrote in message news:<c2soid$191t46$1 at ID-190842.news.uni-berlin.de>...
> hi, 
> 
> id like to do the following: 
> 
> (1) open a .xml, change something and save it. 
> problem is: how to save/serialize? 
> i tried xml.dom.ext.Print, but this resolves all entities and serializes 
> the xml with resolved entities. (see example below)

Sounds as if you want a lexical round-trip.  Very few XML processing
packages allow for this.  I'd check whether pxdom supports this.  If
not, I don't expect you'll find it in Python.

http://www.doxdesk.com/software/py/pxdom.html

> (2) id also like to load external parsed entities referenced in the xml. 
> MSXML provides an extension(?) to DOM which returns the uri to an 
> entityReference-NODE. 
> any similar in pyXML.  actually, is nodetype entityReference implemented 
> in pyXML. i always get the nodeType of the resolved entity, ie 3
> (NODE_TEXT) with a internal unparsed entity.

Again pxdom will get you closest.

--Uche



More information about the Python-list mailing list