[xml] disabling entity replacement



I am building Atom/RSS SAX2 parser using libxml, and in order to
implement http://www.atomenabled.org/developers/syndication/#text for
type="xhtml", I need to be able to completely disable entity
replacement.

I was hoping that setting ctxt->replaceEntities to 0 would do the
trick, but it seems to be ignored in too many places, most importantly
at the very end of xmlParseReference (in parser.c), where it emits
replacement using ctxt->sax->characters() whether or not
ctxt->replaceEntities is set.

It would seem that xmlParseReference code should check the value of
replaceEntities and if not set, emit the name of the entity rather
then the value, along the lines of what xmlParseAttValueComplex does. Or perhaps call ctxt->sax->reference().

Is this a bug or a feature?  Is there a different mechanism for
disabling entity processing?

Thank you,
- Alex



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]