summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2005-02-05 12:06:19 +0000
committerMike Hommey <mh@glandium.org>2005-02-05 12:06:19 +0000
commita7457388701e6ccba9091ba3ec09505dc903b758 (patch)
tree80a7d0fba3968fee73cc71a62ffe1af039396f29 /parser.c
parentf51dd67f3a3f472af0620391eb588eeca4533689 (diff)
downloadlibxml2-a7457388701e6ccba9091ba3ec09505dc903b758.tar.gz
Load /tmp/tmp.5kkLmZ/libxml2-2.6.17 intoupstream/2.6.17
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/parser.c b/parser.c
index baa9c47..8c8e6b9 100644
--- a/parser.c
+++ b/parser.c
@@ -57,7 +57,10 @@
#ifdef LIBXML_CATALOG_ENABLED
#include <libxml/catalog.h>
#endif
-
+#ifdef LIBXML_SCHEMAS_ENABLED
+#include <libxml/xmlschemastypes.h>
+#include <libxml/relaxng.h>
+#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
@@ -2418,6 +2421,7 @@ xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
while (*in != 0 && *in == *cmp) {
++in;
++cmp;
+ ctxt->input->col++;
}
if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
/* success */
@@ -3198,10 +3202,10 @@ xmlParseCharData(xmlParserCtxtPtr ctxt, int cdata) {
get_more_space:
while (*in == 0x20) in++;
if (*in == 0xA) {
- ctxt->input->line++;
+ ctxt->input->line++; ctxt->input->col = 1;
in++;
while (*in == 0xA) {
- ctxt->input->line++;
+ ctxt->input->line++; ctxt->input->col = 1;
in++;
}
goto get_more_space;
@@ -3234,13 +3238,15 @@ get_more:
((*in > '&') && (*in < '<')) ||
((*in > '<') && (*in < ']')) ||
((*in >= 0x20) && (*in < '&')) ||
- (*in == 0x09))
- in++;
+ (*in == 0x09)) {
+ in++;
+ ctxt->input->col++;
+ }
if (*in == 0xA) {
- ctxt->input->line++;
+ ctxt->input->line++; ctxt->input->col = 1;
in++;
while (*in == 0xA) {
- ctxt->input->line++;
+ ctxt->input->line++; ctxt->input->col = 1;
in++;
}
goto get_more;
@@ -3252,6 +3258,7 @@ get_more:
return;
}
in++;
+ ctxt->input->col++;
goto get_more;
}
nbchar = in - ctxt->input->cur;
@@ -3285,7 +3292,7 @@ get_more:
if (*in == 0xA) {
ctxt->input->cur = in;
in++;
- ctxt->input->line++;
+ ctxt->input->line++; ctxt->input->col = 1;
continue; /* while */
}
in--;
@@ -9253,6 +9260,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
(!ctxt->disableSAX))
ctxt->sax->endElementNs(ctxt->userData, name,
prefix, URI);
+ if (ctxt->nsNr - nsNr > 0)
+ nsPop(ctxt, ctxt->nsNr - nsNr);
#ifdef LIBXML_SAX1_ENABLED
} else {
if ((ctxt->sax != NULL) &&
@@ -9921,8 +9930,10 @@ xmlStopParser(xmlParserCtxtPtr ctxt) {
return;
ctxt->instate = XML_PARSER_EOF;
ctxt->disableSAX = 1;
- if (ctxt->input != NULL)
+ if (ctxt->input != NULL) {
ctxt->input->cur = BAD_CAST"";
+ ctxt->input->base = ctxt->input->cur;
+ }
}
/**
@@ -11489,8 +11500,9 @@ xmlCreateURLParserCtxt(const char *filename, int options)
return(NULL);
}
- if (options != 0)
- xmlCtxtUseOptions(ctxt, options);
+ if (options)
+ xmlCtxtUseOptions(ctxt, options);
+ ctxt->linenumbers = 1;
inputStream = xmlLoadExternalEntity(filename, NULL, ctxt);
if (inputStream == NULL) {
@@ -12732,7 +12744,7 @@ xmlCtxtReadFile(xmlParserCtxtPtr ctxt, const char *filename,
xmlCtxtReset(ctxt);
- stream = xmlNewInputFromFile(ctxt, filename);
+ stream = xmlLoadExternalEntity(filename, NULL, ctxt);
if (stream == NULL) {
return (NULL);
}