1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

Fixes for xmlInitParserCtxt

let's make sure that parser options are updated too when a corrsponding
global variable or other field of the context is set.
This commit is contained in:
Daniel Veillard 2014-06-11 16:59:16 +08:00
parent dd8367da17
commit c35af8b18d

View File

@ -1691,12 +1691,20 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
ctxt->nsWellFormed = 1;
ctxt->valid = 1;
ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
if (ctxt->loadsubset) {
ctxt->options |= XML_PARSE_DTDLOAD;
}
ctxt->validate = xmlDoValidityCheckingDefaultValue;
ctxt->pedantic = xmlPedanticParserDefaultValue;
if (ctxt->pedantic) {
ctxt->options |= XML_PARSE_PEDANTIC;
}
ctxt->linenumbers = xmlLineNumbersDefaultValue;
ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
if (ctxt->keepBlanks == 0)
if (ctxt->keepBlanks == 0) {
ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
ctxt->options |= XML_PARSE_NOBLANKS;
}
ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0;
ctxt->vctxt.userData = ctxt;
@ -1708,8 +1716,12 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
else
ctxt->vctxt.warning = xmlParserValidityWarning;
ctxt->vctxt.nodeMax = 0;
ctxt->options |= XML_PARSE_DTDVALID;
}
ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
if (ctxt->replaceEntities) {
ctxt->options |= XML_PARSE_NOENT;
}
ctxt->record_info = 0;
ctxt->nbChars = 0;
ctxt->checkIndex = 0;