This patch applies to bug # 441449.
It seems that doContent() should be called with
startTagLevel = 0 for the document entity, and
startTagLevel = 1 for external entities.
This is how contentProcessor() and
externalEntityContentProcessor() are doing it.
So, I propose to change cdataSectionProcessor like
this:
...
if (start) {
if (parentParser) {
processor = externalEntityContentProcessor;
return externalEntityContentProcessor(parser,
start, end, endPtr);
}
else {
processor = contentProcessor;
return contentProcessor(parser,
start, end, endPtr);
}
}
...
This seems to fix at least the bug demo example
supplied with bug # 441449.
The patch requires that parentParser is always set
for external entities, therefore it will only
work on newer versions of Expat (1.95.3+).
I also found a small bug that needs fixing:
In function ExternalEntityparserCreate(),
the assignment to parentParser should
be pulled out of the conditional section,
like this:
...
parentParser = oldParser;
#ifdef XML_DTD
paramEntityParsing = oldParamEntityParsing;
prologState.inEntityValue = oldInEntityValue;
// parentParser = oldParser; -> move out of here
if (context) {
#endif /* XML_DTD */
...
Karl
Logged In: YES
user_id=290026
Patch checked in.
Karl