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

Function xmlParseEndTag1

ThirdParty/libxml2/vtklibxml2/parser.c:8527–8574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8525 */
8526
8527static void
8528xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
8529 const xmlChar *name;
8530
8531 GROW;
8532 if ((RAW != '<') || (NXT(1) != '/')) {
8533 xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED,
8534 "xmlParseEndTag: '</' not found\n");
8535 return;
8536 }
8537 SKIP(2);
8538
8539 name = xmlParseNameAndCompare(ctxt,ctxt->name);
8540
8541 /*
8542 * We should definitely be at the ending "S? '>'" part
8543 */
8544 GROW;
8545 SKIP_BLANKS;
8546 if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
8547 xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
8548 } else
8549 NEXT1;
8550
8551 /*
8552 * [ WFC: Element Type Match ]
8553 * The Name in an element's end-tag must match the element type in the
8554 * start-tag.
8555 *
8556 */
8557 if (name != (xmlChar*)1) {
8558 if (name == NULL) name = BAD_CAST "unparsable";
8559 xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
8560 "Opening and ending tag mismatch: %s line %d and %s\n",
8561 ctxt->name, line, name);
8562 }
8563
8564 /*
8565 * SAX: End of Tag
8566 */
8567 if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
8568 (!ctxt->disableSAX))
8569 ctxt->sax->endElement(ctxt->userData, ctxt->name);
8570
8571 namePop(ctxt);
8572 spacePop(ctxt);
8573 return;
8574}
8575
8576/**
8577 * xmlParseEndTag:

Callers 1

xmlParseEndTagFunction · 0.85

Calls 4

xmlParseNameAndCompareFunction · 0.85
xmlFatalErrFunction · 0.85
namePopFunction · 0.85
spacePopFunction · 0.85

Tested by

no test coverage detected