MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlParseInternalSubset

Function xmlParseInternalSubset

ThirdParty/libxml2/vtklibxml2/parser.c:8210–8265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8208 */
8209
8210static void
8211xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
8212 /*
8213 * Is there any DTD definition ?
8214 */
8215 if (RAW == '[') {
8216 int oldInputNr = ctxt->inputNr;
8217
8218 NEXT;
8219 /*
8220 * Parse the succession of Markup declarations and
8221 * PEReferences.
8222 * Subsequence (markupdecl | PEReference | S)*
8223 */
8224 SKIP_BLANKS;
8225 while (((RAW != ']') || (ctxt->inputNr > oldInputNr)) &&
8226 (PARSER_STOPPED(ctxt) == 0)) {
8227
8228 /*
8229 * Conditional sections are allowed from external entities included
8230 * by PE References in the internal subset.
8231 */
8232 if ((PARSER_EXTERNAL(ctxt)) &&
8233 (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
8234 xmlParseConditionalSections(ctxt);
8235 } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
8236 xmlParseMarkupDecl(ctxt);
8237 } else if (RAW == '%') {
8238 xmlParsePEReference(ctxt);
8239 } else {
8240 xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
8241 break;
8242 }
8243 SKIP_BLANKS_PE;
8244 SHRINK;
8245 GROW;
8246 }
8247
8248 while (ctxt->inputNr > oldInputNr)
8249 xmlPopPE(ctxt);
8250
8251 if (RAW == ']') {
8252 NEXT;
8253 SKIP_BLANKS;
8254 }
8255 }
8256
8257 /*
8258 * We should be at the end of the DOCTYPE declaration.
8259 */
8260 if ((ctxt->wellFormed) && (RAW != '>')) {
8261 xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
8262 return;
8263 }
8264 NEXT;
8265}
8266
8267#ifdef LIBXML_SAX1_ENABLED

Callers 2

xmlParseDocumentFunction · 0.85
parser.cFile · 0.85

Calls 5

xmlParseMarkupDeclFunction · 0.85
xmlParsePEReferenceFunction · 0.85
xmlFatalErrFunction · 0.85
xmlPopPEFunction · 0.85

Tested by

no test coverage detected