* 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 ">", * and must, for compatibility, be escaped using ">" or a character * reference when it appears in the string "
| 4772 | * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) |
| 4773 | */ |
| 4774 | static void |
| 4775 | xmlParseCharDataInternal(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 { |
| 4789 | get_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 | |
| 4829 | get_more: |
| 4830 | ccol = ctxt->input->col; |
| 4831 | while (test_char_data[*in]) { |
no test coverage detected