Message202037
Brecht Machiels, 03.11.2013 11:58:
> With Python 3.2, I subclassed ElementTree.XMLParser to set ExternalEntityRefHandler on the XMLParser's (expat) 'parser' member
This sounds like a request for a missing feature to me. Here is how lxml
handles it:
http://lxml.de/resolvers.html
> I understand the 'parser' member is not part of the public API
Correct, although the fact that it is not prefixed with an underscore is
rather unfortunate. IMHO, there is no guarantee that the underlying parser
will always be expat, and in fact, it is not in lxml.
> I see two possible solutions:
> 1) Have XMLParser (both the C and Python versions) accept an optional parser argument, so that a custom parser can be passed in.
-1. IMHO, the underlying parser should not be made a part of the API.
Instead, whatever features it provides that are needed on user side should
be mapped and abstracted in one way or another. Resolving external entity
references is something that should not be done as low-level as expat. |
|
Date |
User |
Action |
Args |
2013-11-03 16:43:48 | scoder | set | recipients:
+ scoder, r.david.murray, eli.bendersky, brechtm |
2013-11-03 16:43:48 | scoder | link | issue19483 messages |
2013-11-03 16:43:47 | scoder | create | |
|