This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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.
History
Date User Action Args
2009-02-03 22:32:58damiensetrecipients: + damien, loewis, akuchling, pboddie, exarkun, ajaksu2, vdupras
2009-02-03 22:32:58damiensetmessageid: <1233700378.35.0.83733174393.issue2124@psf.upfronthosting.co.za>
2009-02-03 22:32:56damienlinkissue2124 messages
2009-02-03 22:32:56damiencreate