Re: [xml] Entities defined using other entities

That makes perfect sense.
The doc only suggests to use
xmlSubstituteEntitiesDefault(). Looking at xmllint source, I found out
that both xmlSubstituteEntitiesDefault and XML_PARSE_NOENT were used. 
Also in this document, the second command line has ./tester instead
of ./xmllint.

Thanks for the help and for libxml2,

On Wed, 2006-11-22 at 17:15 -0500, Daniel Veillard wrote:
On Wed, Nov 22, 2006 at 04:36:51PM -0500, christophe barbe wrote:
In case somebody else has the same problem,
xmlSubstituteEntitiesDefault() was not helpful but setting
XML_PARSE_NOENT in the third argument of xmlReadFile() did the job.

There is a good explanation for that:
xmlSubstituteEntitiesDefault is based on global variables, changing behaviour
of a shared library using a global variable is evil, simply because you may
not be the only user of that library within a given program. That's why
all the new APIs rely on flags passed to each parser to modify the
behaviour, xmlReadxxx() are part of those new APIs, that's why they won't
be affected by xmlSubstituteEntitiesDefault().


Christophe Barbe - Software Engineer
Objective Systems, Inc.
Tel: +1 (484) 875-9841
Fax: +1 (484) 875-9830
Toll-free: (877) 307-6855 (USA only)

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