diff --git a/parser.c b/parser.c index 7f054e09..ad8675d2 100644 --- a/parser.c +++ b/parser.c @@ -10320,7 +10320,8 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) { * XML declaration but it does not have a standalone attribute. * It will be overwritten later if a standalone attribute is found. */ - ctxt->input->standalone = -2; + + ctxt->standalone = -2; /* * We know that 'input->standalone = xmlParseSDDecl(ctxt); + ctxt->standalone = xmlParseSDDecl(ctxt); SKIP_BLANKS; if ((RAW == '?') && (NXT(1) == '>')) { @@ -10525,7 +10526,6 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { */ return(-1); } - ctxt->standalone = ctxt->input->standalone; SKIP_BLANKS; } else { ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION); @@ -11265,7 +11265,6 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { xmlHaltParser(ctxt); return(0); } - ctxt->standalone = ctxt->input->standalone; if ((ctxt->encoding == NULL) && (ctxt->input->encoding != NULL)) ctxt->encoding = xmlStrdup(ctxt->input->encoding); diff --git a/parserInternals.c b/parserInternals.c index 11324b2a..ed2d3dee 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -1601,7 +1601,6 @@ xmlNewInputStream(xmlParserCtxtPtr ctxt) { memset(input, 0, sizeof(xmlParserInput)); input->line = 1; input->col = 1; - input->standalone = -1; /* * If the context is NULL the id cannot be initialized, but that