[XML-SIG] my own entity defs when parsing with etree?

Stuart McGraw smcg4191 at frii.com
Sun Jul 12 21:35:10 CEST 2009


I could use some really basic help about using Etree.
I have tried reading the etree and expat doc but I
don't understand most of it.

I have an xml file that contains a dtd that defines a 
number of entities that are subsequently referenced 
in the xml. 

What I would like to do:

1) Parse the xml file but override some or all of the 
entity definitions in the dtd with my own definitions.

2) Parse strings containing elements extracted from
the full xml file, without the dtd, and supplying my 
own entity map to resolve any entities.

I am nearly clueless when it comes to xml processesing
so if I could get a code snippet illustrating how to 
do the above, that would be wonderful!  I am currently 
using the stock Python 2.6 elementTree, but could 
switch to lxml's if that would help.

More information about the XML-SIG mailing list