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 exarkun
Recipients ajaksu2, akuchling, damien, exarkun, loewis, pboddie, vdupras
Date 2009-02-03.21:40:13
SpamBayes Score 0.0011902205
Marked as misclassified No
Message-id <>
Though it's inconvenient to do so, you can arrange to have the locator
available from the entity resolver.  The content handler's
setDocumentLocator method will be called early on with the locator
object.  So you can give your entity resolver a reference to your
content handler and save a reference to the document locator in the
content handler.  Then in the entity resolver's resolveEntity method you
can reach over into the content handler and grab the document locator to
call its getSystemId method.

Note that you have to be careful with the InputStreams you return from
resolveEntity.  I wasn't aware of this before (and perhaps I've
misinterpreted some observer), but I just noticed that if you return an
InputSource based on a file object, the file object's name will be used
as the document id!  This is quite not what you want.  InputStream has a
setSystemId method, but even if you call it before you call
setByteStream, the system id will be the name of the file object passed
to setByteStream.  Perhaps calling these two methods in the opposite
order will fix this, I'm not sure, I haven't tried.
Date User Action Args
2009-02-03 21:40:15exarkunsetrecipients: + exarkun, loewis, akuchling, pboddie, ajaksu2, vdupras, damien
2009-02-03 21:40:15exarkunsetmessageid: <>
2009-02-03 21:40:14exarkunlinkissue2124 messages
2009-02-03 21:40:13exarkuncreate