| 9744 | */ |
| 9745 | |
| 9746 | static void |
| 9747 | xmlParseContentInternal(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. |
no test coverage detected