elementtree and entities

R

rurpy

I need to parse little snipits of xml that come from a file
that has a large DTD that defines hundreds or entities.
But when these snipits are parsed (with elementtree.XML())
without the DTD, the entities are undefined and cause a
parse failure.

Is there any way to tell elementtree to not fail on undefined
entities but just return the entity as text? (Or is this something
I have to get the underlying parser to do? How?)

Alternatively, can I supply my own entity mapping to elementtree?
Prepending the large DTD to each little snippit before parsing
seems awfully inefficient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top