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

Function xmlParseContentInternal

ThirdParty/libxml2/vtklibxml2/parser.c:9746–9841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9744 */
9745
9746static void
9747xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
9748 int oldNameNr = ctxt->nameNr;
9749 int oldSpaceNr = ctxt->spaceNr;
9750 int oldNodeNr = ctxt->nodeNr;
9751
9752 GROW;
9753 while ((ctxt->input->cur < ctxt->input->end) &&
9754 (PARSER_STOPPED(ctxt) == 0)) {
9755 const xmlChar *cur = ctxt->input->cur;
9756
9757 /*
9758 * First case : a Processing Instruction.
9759 */
9760 if ((*cur == '<') && (cur[1] == '?')) {
9761 xmlParsePI(ctxt);
9762 }
9763
9764 /*
9765 * Second case : a CDSection
9766 */
9767 /* 2.6.0 test was *cur not RAW */
9768 else if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
9769 xmlParseCDSect(ctxt);
9770 }
9771
9772 /*
9773 * Third case : a comment
9774 */
9775 else if ((*cur == '<') && (NXT(1) == '!') &&
9776 (NXT(2) == '-') && (NXT(3) == '-')) {
9777 xmlParseComment(ctxt);
9778 }
9779
9780 /*
9781 * Fourth case : a sub-element.
9782 */
9783 else if (*cur == '<') {
9784 if (NXT(1) == '/') {
9785 if (ctxt->nameNr <= oldNameNr)
9786 break;
9787 xmlParseElementEnd(ctxt);
9788 } else {
9789 xmlParseElementStart(ctxt);
9790 }
9791 }
9792
9793 /*
9794 * Fifth case : a reference. If if has not been resolved,
9795 * parsing returns it's Name, create the node
9796 */
9797
9798 else if (*cur == '&') {
9799 xmlParseReference(ctxt);
9800 }
9801
9802 /*
9803 * Last case, text. Note that References are handled directly.

Callers 5

xmlParseContentFunction · 0.85
xmlParseElementFunction · 0.85
xmlParseExtParsedEntFunction · 0.85
xmlCtxtParseContentFunction · 0.85
xmlParseInNodeContextFunction · 0.85

Calls 11

xmlParsePIFunction · 0.85
xmlParseCDSectFunction · 0.85
xmlParseCommentFunction · 0.85
xmlParseElementEndFunction · 0.85
xmlParseElementStartFunction · 0.85
xmlParseReferenceFunction · 0.85
xmlParseCharDataInternalFunction · 0.85
nodePopFunction · 0.85
xmlParserNsPopFunction · 0.85
namePopFunction · 0.85
spacePopFunction · 0.85

Tested by

no test coverage detected