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

Function xmlParseCharDataInternal

ThirdParty/libxml2/vtklibxml2/parser.c:4774–4910  ·  view source on GitHub ↗

* xmlParseCharDataInternal: * @ctxt: an XML parser context * @partial: buffer may contain partial UTF-8 sequences * * Parse character data. Always makes progress if the first char isn't * '<' or '&'. * * The right angle bracket (>) may be represented using the string "&gt;", * and must, for compatibility, be escaped using "&gt;" or a character * reference when it appears in the string "

Source from the content-addressed store, hash-verified

4772 * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
4773 */
4774static void
4775xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
4776 const xmlChar *in;
4777 int nbchar = 0;
4778 int line = ctxt->input->line;
4779 int col = ctxt->input->col;
4780 int ccol;
4781
4782 GROW;
4783 /*
4784 * Accelerated common case where input don't need to be
4785 * modified before passing it to the handler.
4786 */
4787 in = ctxt->input->cur;
4788 do {
4789get_more_space:
4790 while (*in == 0x20) { in++; ctxt->input->col++; }
4791 if (*in == 0xA) {
4792 do {
4793 ctxt->input->line++; ctxt->input->col = 1;
4794 in++;
4795 } while (*in == 0xA);
4796 goto get_more_space;
4797 }
4798 if (*in == '<') {
4799 nbchar = in - ctxt->input->cur;
4800 if (nbchar > 0) {
4801 const xmlChar *tmp = ctxt->input->cur;
4802 ctxt->input->cur = in;
4803
4804 if ((ctxt->sax != NULL) &&
4805 (ctxt->disableSAX == 0) &&
4806 (ctxt->sax->ignorableWhitespace !=
4807 ctxt->sax->characters)) {
4808 if (areBlanks(ctxt, tmp, nbchar, 1)) {
4809 if (ctxt->sax->ignorableWhitespace != NULL)
4810 ctxt->sax->ignorableWhitespace(ctxt->userData,
4811 tmp, nbchar);
4812 } else {
4813 if (ctxt->sax->characters != NULL)
4814 ctxt->sax->characters(ctxt->userData,
4815 tmp, nbchar);
4816 if (*ctxt->space == -1)
4817 *ctxt->space = -2;
4818 }
4819 } else if ((ctxt->sax != NULL) &&
4820 (ctxt->disableSAX == 0) &&
4821 (ctxt->sax->characters != NULL)) {
4822 ctxt->sax->characters(ctxt->userData,
4823 tmp, nbchar);
4824 }
4825 }
4826 return;
4827 }
4828
4829get_more:
4830 ccol = ctxt->input->col;
4831 while (test_char_data[*in]) {

Callers 3

xmlParseCharDataFunction · 0.85
xmlParseContentInternalFunction · 0.85
parser.cFile · 0.85

Calls 3

xmlFatalErrFunction · 0.85
xmlParseCharDataComplexFunction · 0.85
areBlanksFunction · 0.70

Tested by

no test coverage detected