Message81108
| Author |
damien |
| Recipients |
ajaksu2, akuchling, damien, exarkun, loewis, pboddie, vdupras |
| Date |
2009年02月03日.22:32:56 |
| SpamBayes Score |
3.229612e-07 |
| Marked as misclassified |
No |
| Message-id |
<1233700378.35.0.83733174393.issue2124@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|