[Expat-discuss] Parsing external entities

Lee Passey lee at novomail.net
Tue Dec 12 17:16:50 CET 2006


I need some help parsing external entities.

Based on the documentation, I would expect that 1. if I register a 
ExternalEntityRefHandler, and that 2. if I instantiate an entity parser 
with XML_ExternalEntityParserCreate, and that 3. if the entity parser 
successfully parses the external entity file (as indicated by returning 
XML_STATUS_OK), then whenever an entity is encountered in the XML the 
replacement value will appear in my CharacterDataHandler; or if the 
entity has not be parsed by the entity parser the my 
SkippedEntityHandler will be called.

The code does not behave this way. The external entity file is parsed 
successfully, but my SkippedEntityHandler gets called for /all/ external 
entities, whether parsed or unparsed, and the parsed data is /never/ 
passed to the CharacterDataHandler.

I can see three possibilities for this behavior: 1. there is a bug in 
the code, 2. the documentation is incorrect, or 3. there is some 
undocumented prerequisite that I must do to make it work.

Can someone shed some light on how this process is supposed to work and 
what I must do to parse external entities?


-- 
Nothing of significance below this line.




More information about the Expat-discuss mailing list