Message81108
On Feb 3, 2009, at 1:42 PM, Martin v. Löwis wrote:
> Sure. But ContentHandler.setDocumentLocator receives it, and you are
> supposed to store it for the entire parse, to always know what entity
> is being processed if you want to.
Where in the following sequence am I supposed to receive the document
locator?
parser = xml.sax.make_parser()
parser.setEntityResolver(CachingEntityResolver())
doc = xml.dom.minidom.parse('file.xml', parser)
The content handler is being created deep inside xml.dom. It does, in
fact, store the document locator, but not in any place that I can easily
access without breaking several layers of abstraction.
Or, as a more general question: How can I get a DOM tree that includes
external entities? If there's an easy way to do it, the documentation
does not make it clear at all. |
|
Date |
User |
Action |
Args |
2009-02-03 22:32:58 | damien | set | recipients:
+ damien, loewis, akuchling, pboddie, exarkun, ajaksu2, vdupras |
2009-02-03 22:32:58 | damien | set | messageid: <1233700378.35.0.83733174393.issue2124@psf.upfronthosting.co.za> |
2009-02-03 22:32:56 | damien | link | issue2124 messages |
2009-02-03 22:32:56 | damien | create | |
|