pyXML:save changes made to DOM-tree, get entity-uri

Sebastian Fey fey at parsytec.de
Thu Mar 11 16:34:17 EST 2004


 

	(hope MSOWebAccess will send this message as plain text)
	 
	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)

	 

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

	
	############# 
	<?xml version="1.0" encoding="iso-8859-1"?> 
	<!DOCTYPE xbel [ 
	        <!ENTITY intTxt 'GIGI'> 
	        <!ENTITY intMarkup '<entIntern>text</entIntern>'> 
	        <!ENTITY extParsed SYSTEM "ent.xml"> 
	]> 
	<root> 
	        <text>&intTxt;</text> 
	        &intMarkup; 
	        &extParsed; 
	</root> 
	############ 

	becomes: 

	############# 
	<?xml version="1.0" encoding="iso-8859-1"?> 
	<root> 
	        <text>some text</text> 
	        <entIntern>text</entIntern>' 
	        <entIntern>text</entIntern>' 
	</root> 
	############# 


	thx, 
	        Sebastian 





More information about the Python-list mailing list