Large commit of changes done while travelling to XML'99
- cleanups on memory use and parsers
- start of Link interfaces HTML and XLink
- rebuild the doc
- released as 1.8.0
Daniel
diff --git a/ChangeLog b/ChangeLog
index f3ec0f5..76a5dd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+Sun Dec 12 13:08:15 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
+
+ * configure.in, doc/xml.html : bumped to 1.8.0
+ * xlink.[ch], Makefile.am : added framework for link detection
+ * parser.h: added nbChars to parser context, needed for cleanup.
+ * xmlmemory.c: removed a nasty bug when out of mem
+ * valid.[ch]: adding namespace support for attribute decl
+ * tester.c: added --debugent option
+ * debugXML.[ch]: added xmlDebugDumpEntities()
+ * parser.c: cleanup, avoiding use of CUR_PTR like plague, using
+ buffers instead, this was really needed, validation was breaking
+ in strange ways due to that. Added xmlParseStringPEReference()
+ and other parsing from strings functions. Entities processing
+ modified again, but PERef are still not handled correcly but
+ unless you're Eve Maller you won't notice :-)
+ * HTMLparser.c: large changes toward reliability, and switched to
+ lowercase internal tags, XHTML is lowercase, so it will help
+ that output is closer to next version.
+ * doc/* : regenerated the documentation, it is now hosted at
+ http://xmlsoft.org/ (same bits I just bought the domain :-)
+
+
Fri Dec 3 13:46:32 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* SAX.h, SAX.c, makefile.am: added SAX.h mostly useful for the
diff --git a/Makefile.am b/Makefile.am
index 54d6228..ed0b2bb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,7 +28,8 @@
xmlIO.c \
xmlmemory.c \
nanohttp.c \
- valid.c
+ valid.c \
+ xlink.c
xmlincdir = $(includedir)/gnome-xml
xmlinc_HEADERS = \
@@ -46,7 +47,8 @@
xmlIO.h \
xmlmemory.h \
nanohttp.h \
- valid.h
+ valid.h \
+ xlink.h
DEPS = $(top_builddir)/libxml.la
LDADDS = $(top_builddir)/libxml.la @Z_LIBS@ @M_LIBS@
diff --git a/SAX.h b/SAX.h
index 8d9f3c7..0424fa7 100644
--- a/SAX.h
+++ b/SAX.h
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
+#include "xlink.h"
#ifndef __XML_SAX_H__
#define __XML_SAX_H__
diff --git a/configure.in b/configure.in
index 4b8c4c8..4c50f34 100644
--- a/configure.in
+++ b/configure.in
@@ -4,8 +4,8 @@
AM_CONFIG_HEADER(config.h)
LIBXML_MAJOR_VERSION=1
-LIBXML_MINOR_VERSION=7
-LIBXML_MICRO_VERSION=4
+LIBXML_MINOR_VERSION=8
+LIBXML_MICRO_VERSION=0
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
diff --git a/debugXML.c b/debugXML.c
index ab799f7..650fc59 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -280,3 +280,136 @@
if (doc->root != NULL)
xmlDebugDumpNodeList(output, doc->root, 1);
}
+
+void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc) {
+ int i;
+ xmlEntityPtr cur;
+
+ if (output == NULL) output = stdout;
+ if (doc == NULL) {
+ fprintf(output, "DOCUMENT == NULL !\n");
+ return;
+ }
+
+ switch (doc->type) {
+ case XML_ELEMENT_NODE:
+ fprintf(output, "Error, ELEMENT found here ");
+ break;
+ case XML_ATTRIBUTE_NODE:
+ fprintf(output, "Error, ATTRIBUTE found here\n");
+ break;
+ case XML_TEXT_NODE:
+ fprintf(output, "Error, TEXT\n");
+ break;
+ case XML_CDATA_SECTION_NODE:
+ fprintf(output, "Error, CDATA_SECTION\n");
+ break;
+ case XML_ENTITY_REF_NODE:
+ fprintf(output, "Error, ENTITY_REF\n");
+ break;
+ case XML_ENTITY_NODE:
+ fprintf(output, "Error, ENTITY\n");
+ break;
+ case XML_PI_NODE:
+ fprintf(output, "Error, PI\n");
+ break;
+ case XML_COMMENT_NODE:
+ fprintf(output, "Error, COMMENT\n");
+ break;
+ case XML_DOCUMENT_NODE:
+ fprintf(output, "DOCUMENT\n");
+ break;
+ case XML_HTML_DOCUMENT_NODE:
+ fprintf(output, "HTML DOCUMENT\n");
+ break;
+ case XML_DOCUMENT_TYPE_NODE:
+ fprintf(output, "Error, DOCUMENT_TYPE\n");
+ break;
+ case XML_DOCUMENT_FRAG_NODE:
+ fprintf(output, "Error, DOCUMENT_FRAG\n");
+ break;
+ case XML_NOTATION_NODE:
+ fprintf(output, "Error, NOTATION\n");
+ break;
+ default:
+ fprintf(output, "NODE_%d\n", doc->type);
+ }
+ if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
+ xmlEntitiesTablePtr table = (xmlEntitiesTablePtr)
+ doc->intSubset->entities;
+ fprintf(output, "Entities in internal subset\n");
+ for (i = 0;i < table->nb_entities;i++) {
+ cur = &table->table[i];
+ fprintf(output, "%d : %s : ", i, cur->name);
+ switch (cur->type) {
+ case XML_INTERNAL_GENERAL_ENTITY:
+ fprintf(output, "INTERNAL GENERAL");
+ break;
+ case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
+ fprintf(output, "EXTERNAL PARSED");
+ break;
+ case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
+ fprintf(output, "EXTERNAL UNPARSED");
+ break;
+ case XML_INTERNAL_PARAMETER_ENTITY:
+ fprintf(output, "INTERNAL PARAMETER");
+ break;
+ case XML_EXTERNAL_PARAMETER_ENTITY:
+ fprintf(output, "EXTERNAL PARAMETER");
+ break;
+ default:
+ fprintf(output, "UNKNOWN TYPE %d",
+ cur->type);
+ }
+ if (cur->ExternalID != NULL)
+ fprintf(output, "ID \"%s\"", cur->ExternalID);
+ if (cur->SystemID != NULL)
+ fprintf(output, "SYSTEM \"%s\"", cur->SystemID);
+ if (cur->orig != NULL)
+ fprintf(output, "\n orig \"%s\"", cur->orig);
+ if (cur->content != NULL)
+ fprintf(output, "\n content \"%s\"", cur->content);
+ fprintf(output, "\n");
+ }
+ } else
+ fprintf(output, "No entities in internal subset\n");
+ if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
+ xmlEntitiesTablePtr table = (xmlEntitiesTablePtr)
+ doc->extSubset->entities;
+ fprintf(output, "Entities in external subset\n");
+ for (i = 0;i < table->nb_entities;i++) {
+ cur = &table->table[i];
+ fprintf(output, "%d : %s : ", i, cur->name);
+ switch (cur->type) {
+ case XML_INTERNAL_GENERAL_ENTITY:
+ fprintf(output, "INTERNAL GENERAL");
+ break;
+ case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
+ fprintf(output, "EXTERNAL PARSED");
+ break;
+ case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
+ fprintf(output, "EXTERNAL UNPARSED");
+ break;
+ case XML_INTERNAL_PARAMETER_ENTITY:
+ fprintf(output, "INTERNAL PARAMETER");
+ break;
+ case XML_EXTERNAL_PARAMETER_ENTITY:
+ fprintf(output, "EXTERNAL PARAMETER");
+ break;
+ default:
+ fprintf(output, "UNKNOWN TYPE %d",
+ cur->type);
+ }
+ if (cur->ExternalID != NULL)
+ fprintf(output, "ID \"%s\"", cur->ExternalID);
+ if (cur->SystemID != NULL)
+ fprintf(output, "SYSTEM \"%s\"", cur->SystemID);
+ if (cur->orig != NULL)
+ fprintf(output, "\n orig \"%s\"", cur->orig);
+ if (cur->content != NULL)
+ fprintf(output, "\n content \"%s\"", cur->content);
+ fprintf(output, "\n");
+ }
+ } else
+ fprintf(output, "No entities in external subset\n");
+}
diff --git a/debugXML.h b/debugXML.h
index f73527c..b24219a 100644
--- a/debugXML.h
+++ b/debugXML.h
@@ -16,4 +16,5 @@
extern void xmlDebugDumpNode(FILE *output, xmlNodePtr node, int depth);
extern void xmlDebugDumpNodeList(FILE *output, xmlNodePtr node, int depth);
extern void xmlDebugDumpDocument(FILE *output, xmlDocPtr doc);
+extern void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc);
#endif /* __DEBUG_XML__ */
diff --git a/doc/html/gnome-xml-entities.html b/doc/html/gnome-xml-entities.html
index b0105df..532fe28 100644
--- a/doc/html/gnome-xml-entities.html
+++ b/doc/html/gnome-xml-entities.html
@@ -115,7 +115,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN5370"
+NAME="AEN5438"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN5373"
+NAME="AEN5441"
></A
><H2
>Synopsis</H2
@@ -348,7 +348,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN5431"
+NAME="AEN5499"
></A
><H2
>Description</H2
@@ -358,14 +358,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN5434"
+NAME="AEN5502"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5436"
+NAME="AEN5504"
></A
><H3
><A
@@ -391,7 +391,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5441"
+NAME="AEN5509"
></A
><H3
><A
@@ -417,7 +417,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5446"
+NAME="AEN5514"
></A
><H3
><A
@@ -443,7 +443,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5451"
+NAME="AEN5519"
></A
><H3
><A
@@ -469,7 +469,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5456"
+NAME="AEN5524"
></A
><H3
><A
@@ -495,7 +495,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5461"
+NAME="AEN5529"
></A
><H3
><A
@@ -521,7 +521,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5466"
+NAME="AEN5534"
></A
><H3
><A
@@ -547,7 +547,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5471"
+NAME="AEN5539"
></A
><H3
><A
@@ -573,7 +573,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5476"
+NAME="AEN5544"
></A
><H3
><A
@@ -599,7 +599,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5481"
+NAME="AEN5549"
></A
><H3
><A
@@ -764,7 +764,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5521"
+NAME="AEN5589"
></A
><H3
><A
@@ -929,7 +929,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5561"
+NAME="AEN5629"
></A
><H3
><A
@@ -1010,7 +1010,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5582"
+NAME="AEN5650"
></A
><H3
><A
@@ -1114,7 +1114,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5608"
+NAME="AEN5676"
></A
><H3
><A
@@ -1217,7 +1217,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5634"
+NAME="AEN5702"
></A
><H3
><A
@@ -1320,7 +1320,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5660"
+NAME="AEN5728"
></A
><H3
><A
@@ -1429,7 +1429,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5688"
+NAME="AEN5756"
></A
><H3
><A
@@ -1537,7 +1537,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5715"
+NAME="AEN5783"
></A
><H3
><A
@@ -1598,7 +1598,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5731"
+NAME="AEN5799"
></A
><H3
><A
@@ -1679,7 +1679,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5752"
+NAME="AEN5820"
></A
><H3
><A
@@ -1742,7 +1742,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5768"
+NAME="AEN5836"
></A
><H3
><A
@@ -1826,7 +1826,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5789"
+NAME="AEN5857"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-htmlparser.html b/doc/html/gnome-xml-htmlparser.html
index ef6b025..cca564a 100644
--- a/doc/html/gnome-xml-htmlparser.html
+++ b/doc/html/gnome-xml-htmlparser.html
@@ -115,7 +115,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN7447"
+NAME="AEN7515"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN7450"
+NAME="AEN7518"
></A
><H2
>Synopsis</H2
@@ -277,7 +277,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN7488"
+NAME="AEN7556"
></A
><H2
>Description</H2
@@ -287,14 +287,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN7491"
+NAME="AEN7559"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7493"
+NAME="AEN7561"
></A
><H3
><A
@@ -320,7 +320,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7498"
+NAME="AEN7566"
></A
><H3
><A
@@ -346,7 +346,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7503"
+NAME="AEN7571"
></A
><H3
><A
@@ -372,7 +372,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7508"
+NAME="AEN7576"
></A
><H3
><A
@@ -398,7 +398,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7513"
+NAME="AEN7581"
></A
><H3
><A
@@ -424,7 +424,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7518"
+NAME="AEN7586"
></A
><H3
><A
@@ -450,7 +450,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7523"
+NAME="AEN7591"
></A
><H3
><A
@@ -476,7 +476,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7528"
+NAME="AEN7596"
></A
><H3
><A
@@ -502,7 +502,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7533"
+NAME="AEN7601"
></A
><H3
><A
@@ -528,7 +528,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7538"
+NAME="AEN7606"
></A
><H3
><A
@@ -609,7 +609,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7559"
+NAME="AEN7627"
></A
><H3
><A
@@ -692,7 +692,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7581"
+NAME="AEN7649"
></A
><H3
><A
@@ -797,7 +797,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7608"
+NAME="AEN7676"
></A
><H3
><A
@@ -881,7 +881,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7630"
+NAME="AEN7698"
></A
><H3
><A
@@ -948,7 +948,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7648"
+NAME="AEN7716"
></A
><H3
><A
@@ -1088,7 +1088,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7682"
+NAME="AEN7750"
></A
><H3
><A
@@ -1187,7 +1187,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7707"
+NAME="AEN7775"
></A
><H3
><A
@@ -1325,7 +1325,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7740"
+NAME="AEN7808"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-htmltree.html b/doc/html/gnome-xml-htmltree.html
index 8293f72..a899b16 100644
--- a/doc/html/gnome-xml-htmltree.html
+++ b/doc/html/gnome-xml-htmltree.html
@@ -115,7 +115,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN7769"
+NAME="AEN7837"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN7772"
+NAME="AEN7840"
></A
><H2
>Synopsis</H2
@@ -188,7 +188,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN7786"
+NAME="AEN7854"
></A
><H2
>Description</H2
@@ -198,14 +198,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN7789"
+NAME="AEN7857"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7791"
+NAME="AEN7859"
></A
><H3
><A
@@ -231,7 +231,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7796"
+NAME="AEN7864"
></A
><H3
><A
@@ -257,7 +257,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7801"
+NAME="AEN7869"
></A
><H3
><A
@@ -283,7 +283,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7806"
+NAME="AEN7874"
></A
><H3
><A
@@ -386,7 +386,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7831"
+NAME="AEN7899"
></A
><H3
><A
@@ -470,7 +470,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7852"
+NAME="AEN7920"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-nanohttp.html b/doc/html/gnome-xml-nanohttp.html
index 933ac6d..d3e4afe 100644
--- a/doc/html/gnome-xml-nanohttp.html
+++ b/doc/html/gnome-xml-nanohttp.html
@@ -115,7 +115,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN8149"
+NAME="AEN8217"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN8152"
+NAME="AEN8220"
></A
><H2
>Synopsis</H2
@@ -183,7 +183,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN8162"
+NAME="AEN8230"
></A
><H2
>Description</H2
@@ -193,14 +193,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN8165"
+NAME="AEN8233"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8167"
+NAME="AEN8235"
></A
><H3
><A
@@ -314,7 +314,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8194"
+NAME="AEN8262"
></A
><H3
><A
@@ -453,7 +453,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8226"
+NAME="AEN8294"
></A
><H3
><A
@@ -533,7 +533,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8245"
+NAME="AEN8313"
></A
><H3
><A
@@ -608,7 +608,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8264"
+NAME="AEN8332"
></A
><H3
><A
@@ -731,7 +731,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8293"
+NAME="AEN8361"
></A
><H3
><A
@@ -825,7 +825,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8316"
+NAME="AEN8384"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-parserinternals.html b/doc/html/gnome-xml-parserinternals.html
index 1efc34e..5234c2b 100644
--- a/doc/html/gnome-xml-parserinternals.html
+++ b/doc/html/gnome-xml-parserinternals.html
@@ -115,7 +115,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN8563"
+NAME="AEN8631"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN8566"
+NAME="AEN8634"
></A
><H2
>Synopsis</H2
@@ -886,7 +886,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN8777"
+NAME="AEN8845"
></A
><H2
>Description</H2
@@ -896,14 +896,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN8780"
+NAME="AEN8848"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8782"
+NAME="AEN8850"
></A
><H3
><A
@@ -929,7 +929,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8787"
+NAME="AEN8855"
></A
><H3
><A
@@ -942,7 +942,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8791"
+NAME="AEN8859"
></A
><H3
><A
@@ -1000,7 +1000,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8805"
+NAME="AEN8873"
></A
><H3
><A
@@ -1058,7 +1058,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8819"
+NAME="AEN8887"
></A
><H3
><A
@@ -1116,7 +1116,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8833"
+NAME="AEN8901"
></A
><H3
><A
@@ -1174,7 +1174,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8847"
+NAME="AEN8915"
></A
><H3
><A
@@ -1232,7 +1232,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8861"
+NAME="AEN8929"
></A
><H3
><A
@@ -1290,7 +1290,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8875"
+NAME="AEN8943"
></A
><H3
><A
@@ -1348,7 +1348,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8889"
+NAME="AEN8957"
></A
><H3
><A
@@ -1406,7 +1406,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8903"
+NAME="AEN8971"
></A
><H3
><A
@@ -1464,7 +1464,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8917"
+NAME="AEN8985"
></A
><H3
><A
@@ -1522,7 +1522,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8931"
+NAME="AEN8999"
></A
><H3
><A
@@ -1580,7 +1580,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8945"
+NAME="AEN9013"
></A
><H3
><A
@@ -1638,7 +1638,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8959"
+NAME="AEN9027"
></A
><H3
><A
@@ -1696,7 +1696,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8973"
+NAME="AEN9041"
></A
><H3
><A
@@ -1754,7 +1754,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8987"
+NAME="AEN9055"
></A
><H3
><A
@@ -1835,7 +1835,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9008"
+NAME="AEN9076"
></A
><H3
><A
@@ -1915,7 +1915,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9028"
+NAME="AEN9096"
></A
><H3
><A
@@ -2011,7 +2011,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9052"
+NAME="AEN9120"
></A
><H3
><A
@@ -2075,7 +2075,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9068"
+NAME="AEN9136"
></A
><H3
><A
@@ -2136,7 +2136,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9084"
+NAME="AEN9152"
></A
><H3
><A
@@ -2221,7 +2221,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9105"
+NAME="AEN9173"
></A
><H3
><A
@@ -2308,7 +2308,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9127"
+NAME="AEN9195"
></A
><H3
><A
@@ -2410,7 +2410,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9153"
+NAME="AEN9221"
></A
><H3
><A
@@ -2495,7 +2495,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9174"
+NAME="AEN9242"
></A
><H3
><A
@@ -2577,7 +2577,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9195"
+NAME="AEN9263"
></A
><H3
><A
@@ -2640,7 +2640,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9211"
+NAME="AEN9279"
></A
><H3
><A
@@ -2739,7 +2739,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9236"
+NAME="AEN9304"
></A
><H3
><A
@@ -2848,7 +2848,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9265"
+NAME="AEN9333"
></A
><H3
><A
@@ -2934,7 +2934,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9288"
+NAME="AEN9356"
></A
><H3
><A
@@ -3043,7 +3043,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9317"
+NAME="AEN9385"
></A
><H3
><A
@@ -3128,7 +3128,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9340"
+NAME="AEN9408"
></A
><H3
><A
@@ -3210,7 +3210,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9361"
+NAME="AEN9429"
></A
><H3
><A
@@ -3279,7 +3279,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9379"
+NAME="AEN9447"
></A
><H3
><A
@@ -3368,7 +3368,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9403"
+NAME="AEN9471"
></A
><H3
><A
@@ -3456,7 +3456,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9427"
+NAME="AEN9495"
></A
><H3
><A
@@ -3541,7 +3541,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9450"
+NAME="AEN9518"
></A
><H3
><A
@@ -3646,7 +3646,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9477"
+NAME="AEN9545"
></A
><H3
><A
@@ -3784,7 +3784,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9511"
+NAME="AEN9579"
></A
><H3
><A
@@ -3867,7 +3867,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9533"
+NAME="AEN9601"
></A
><H3
><A
@@ -3950,7 +3950,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9555"
+NAME="AEN9623"
></A
><H3
><A
@@ -4034,7 +4034,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9576"
+NAME="AEN9644"
></A
><H3
><A
@@ -4165,7 +4165,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9609"
+NAME="AEN9677"
></A
><H3
><A
@@ -4232,7 +4232,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9626"
+NAME="AEN9694"
></A
><H3
><A
@@ -4315,7 +4315,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9648"
+NAME="AEN9716"
></A
><H3
><A
@@ -4382,7 +4382,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9666"
+NAME="AEN9734"
></A
><H3
><A
@@ -4457,7 +4457,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9686"
+NAME="AEN9754"
></A
><H3
><A
@@ -4535,7 +4535,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9709"
+NAME="AEN9777"
></A
><H3
><A
@@ -4674,7 +4674,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9746"
+NAME="AEN9814"
></A
><H3
><A
@@ -4763,7 +4763,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9770"
+NAME="AEN9838"
></A
><H3
><A
@@ -4850,7 +4850,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9793"
+NAME="AEN9861"
></A
><H3
><A
@@ -4953,7 +4953,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9820"
+NAME="AEN9888"
></A
><H3
><A
@@ -5097,7 +5097,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9858"
+NAME="AEN9926"
></A
><H3
><A
@@ -5164,7 +5164,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9876"
+NAME="AEN9944"
></A
><H3
><A
@@ -5262,7 +5262,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9902"
+NAME="AEN9970"
></A
><H3
><A
@@ -5365,7 +5365,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9928"
+NAME="AEN9996"
></A
><H3
><A
@@ -5488,7 +5488,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9959"
+NAME="AEN10027"
></A
><H3
><A
@@ -5571,7 +5571,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN9981"
+NAME="AEN10049"
></A
><H3
><A
@@ -5650,7 +5650,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10000"
+NAME="AEN10068"
></A
><H3
><A
@@ -5728,7 +5728,7 @@
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
->the value parsed (as an int)</TD
+>the value parsed (as an int), 0 in case of error</TD
></TR
></TABLE
><P
@@ -5738,7 +5738,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10023"
+NAME="AEN10091"
></A
><H3
><A
@@ -5839,7 +5839,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10047"
+NAME="AEN10115"
></A
><H3
><A
@@ -5913,7 +5913,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10066"
+NAME="AEN10134"
></A
><H3
><A
@@ -5999,7 +5999,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10087"
+NAME="AEN10155"
></A
><H3
><A
@@ -6069,7 +6069,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10105"
+NAME="AEN10173"
></A
><H3
><A
@@ -6194,7 +6194,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10139"
+NAME="AEN10207"
></A
><H3
><A
@@ -6296,7 +6296,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10168"
+NAME="AEN10236"
></A
><H3
><A
@@ -6386,7 +6386,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10192"
+NAME="AEN10260"
></A
><H3
><A
@@ -6457,7 +6457,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10212"
+NAME="AEN10280"
></A
><H3
><A
@@ -6522,7 +6522,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10229"
+NAME="AEN10297"
></A
><H3
><A
@@ -6604,7 +6604,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10248"
+NAME="AEN10316"
></A
><H3
><A
@@ -6687,7 +6687,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10270"
+NAME="AEN10338"
></A
><H3
><A
@@ -6772,7 +6772,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10293"
+NAME="AEN10361"
></A
><H3
><A
@@ -6855,7 +6855,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10315"
+NAME="AEN10383"
></A
><H3
><A
@@ -6940,7 +6940,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10338"
+NAME="AEN10406"
></A
><H3
><A
@@ -7035,7 +7035,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10360"
+NAME="AEN10428"
></A
><H3
><A
@@ -7100,7 +7100,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10377"
+NAME="AEN10445"
></A
><H3
><A
@@ -7165,7 +7165,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10394"
+NAME="AEN10462"
></A
><H3
><A
@@ -7274,7 +7274,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10422"
+NAME="AEN10490"
></A
><H3
><A
@@ -7300,7 +7300,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10427"
+NAME="AEN10495"
></A
><H3
><A
@@ -7326,7 +7326,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10432"
+NAME="AEN10500"
></A
><H3
><A
@@ -7352,7 +7352,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10437"
+NAME="AEN10505"
></A
><H3
><A
@@ -7378,7 +7378,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10442"
+NAME="AEN10510"
></A
><H3
><A
@@ -7561,7 +7561,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10487"
+NAME="AEN10555"
></A
><H3
><A
@@ -7658,7 +7658,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10511"
+NAME="AEN10579"
></A
><H3
><A
@@ -7737,7 +7737,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10531"
+NAME="AEN10599"
></A
><H3
><A
@@ -7834,7 +7834,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN10555"
+NAME="AEN10623"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-tree.html b/doc/html/gnome-xml-tree.html
index 4a9b95c..8c33ca4 100644
--- a/doc/html/gnome-xml-tree.html
+++ b/doc/html/gnome-xml-tree.html
@@ -1056,6 +1056,24 @@
>xmlChar</A
> *name);
<A
+HREF="gnome-xml-tree.html#XMLCHAR"
+>xmlChar</A
+>* <A
+HREF="gnome-xml-tree.html#XMLGETNSPROP"
+>xmlGetNsProp</A
+> (<A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> node,
+ const <A
+HREF="gnome-xml-tree.html#XMLCHAR"
+>xmlChar</A
+> *name,
+ const <A
+HREF="gnome-xml-tree.html#XMLCHAR"
+>xmlChar</A
+> *namespace);
+<A
HREF="gnome-xml-tree.html#XMLNODEPTR"
>xmlNodePtr</A
> <A
@@ -1176,6 +1194,20 @@
HREF="gnome-xml-tree.html#XMLCHAR"
>xmlChar</A
> *lang);
+<A
+HREF="gnome-xml-tree.html#XMLCHAR"
+>xmlChar</A
+>* <A
+HREF="gnome-xml-tree.html#XMLNODEGETBASE"
+>xmlNodeGetBase</A
+> (<A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> cur);
int <A
HREF="gnome-xml-tree.html#XMLREMOVEPROP"
>xmlRemoveProp</A
@@ -1281,7 +1313,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN3157"
+NAME="AEN3166"
></A
><H2
>Description</H2
@@ -1291,14 +1323,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN3160"
+NAME="AEN3169"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3162"
+NAME="AEN3171"
></A
><H3
><A
@@ -1338,7 +1370,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3167"
+NAME="AEN3176"
></A
><H3
><A
@@ -1351,7 +1383,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3171"
+NAME="AEN3180"
></A
><H3
><A
@@ -1377,7 +1409,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3176"
+NAME="AEN3185"
></A
><H3
><A
@@ -1403,7 +1435,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3181"
+NAME="AEN3190"
></A
><H3
><A
@@ -1429,7 +1461,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3186"
+NAME="AEN3195"
></A
><H3
><A
@@ -1466,7 +1498,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3191"
+NAME="AEN3200"
></A
><H3
><A
@@ -1497,7 +1529,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3196"
+NAME="AEN3205"
></A
><H3
><A
@@ -1523,7 +1555,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3201"
+NAME="AEN3210"
></A
><H3
><A
@@ -1549,7 +1581,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3206"
+NAME="AEN3215"
></A
><H3
><A
@@ -1580,7 +1612,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3211"
+NAME="AEN3220"
></A
><H3
><A
@@ -1611,7 +1643,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3216"
+NAME="AEN3225"
></A
><H3
><A
@@ -1637,7 +1669,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3221"
+NAME="AEN3230"
></A
><H3
><A
@@ -1668,7 +1700,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3226"
+NAME="AEN3235"
></A
><H3
><A
@@ -1694,7 +1726,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3231"
+NAME="AEN3240"
></A
><H3
><A
@@ -1723,7 +1755,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3236"
+NAME="AEN3245"
></A
><H3
><A
@@ -1749,7 +1781,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3241"
+NAME="AEN3250"
></A
><H3
><A
@@ -1775,7 +1807,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3246"
+NAME="AEN3255"
></A
><H3
><A
@@ -1801,7 +1833,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3251"
+NAME="AEN3260"
></A
><H3
><A
@@ -1827,7 +1859,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3256"
+NAME="AEN3265"
></A
><H3
><A
@@ -1853,7 +1885,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3261"
+NAME="AEN3270"
></A
><H3
><A
@@ -1884,7 +1916,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3267"
+NAME="AEN3276"
></A
><H3
><A
@@ -1910,7 +1942,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3272"
+NAME="AEN3281"
></A
><H3
><A
@@ -1936,7 +1968,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3277"
+NAME="AEN3286"
></A
><H3
><A
@@ -1962,7 +1994,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3282"
+NAME="AEN3291"
></A
><H3
><A
@@ -1988,7 +2020,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3287"
+NAME="AEN3296"
></A
><H3
><A
@@ -2014,7 +2046,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3292"
+NAME="AEN3301"
></A
><H3
><A
@@ -2040,7 +2072,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3297"
+NAME="AEN3306"
></A
><H3
><A
@@ -2066,7 +2098,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3302"
+NAME="AEN3311"
></A
><H3
><A
@@ -2092,7 +2124,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3307"
+NAME="AEN3316"
></A
><H3
><A
@@ -2118,7 +2150,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3312"
+NAME="AEN3321"
></A
><H3
><A
@@ -2144,7 +2176,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3317"
+NAME="AEN3326"
></A
><H3
><A
@@ -2205,7 +2237,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3333"
+NAME="AEN3342"
></A
><H3
><A
@@ -2286,7 +2318,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3354"
+NAME="AEN3363"
></A
><H3
><A
@@ -2349,7 +2381,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3370"
+NAME="AEN3379"
></A
><H3
><A
@@ -2448,7 +2480,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3395"
+NAME="AEN3404"
></A
><H3
><A
@@ -2477,7 +2509,8 @@
></TR
></TABLE
><P
->Add a string range to an XML buffer.</P
+>Add a string range to an XML buffer. if len == -1, the lenght of
+str is recomputed.</P
><P
></P
><DIV
@@ -2550,7 +2583,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3420"
+NAME="AEN3429"
></A
><H3
><A
@@ -2634,7 +2667,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3441"
+NAME="AEN3450"
></A
><H3
><A
@@ -2715,7 +2748,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3461"
+NAME="AEN3470"
></A
><H3
><A
@@ -2811,7 +2844,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3485"
+NAME="AEN3494"
></A
><H3
><A
@@ -2874,7 +2907,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3501"
+NAME="AEN3510"
></A
><H3
><A
@@ -2955,7 +2988,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3522"
+NAME="AEN3531"
></A
><H3
><A
@@ -3031,7 +3064,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3541"
+NAME="AEN3550"
></A
><H3
><A
@@ -3113,7 +3146,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3561"
+NAME="AEN3570"
></A
><H3
><A
@@ -3191,7 +3224,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3581"
+NAME="AEN3590"
></A
><H3
><A
@@ -3335,7 +3368,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3617"
+NAME="AEN3626"
></A
><H3
><A
@@ -3479,7 +3512,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3653"
+NAME="AEN3662"
></A
><H3
><A
@@ -3542,7 +3575,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3669"
+NAME="AEN3678"
></A
><H3
><A
@@ -3665,7 +3698,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3700"
+NAME="AEN3709"
></A
><H3
><A
@@ -3788,7 +3821,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3731"
+NAME="AEN3740"
></A
><H3
><A
@@ -3851,7 +3884,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3747"
+NAME="AEN3756"
></A
><H3
><A
@@ -3932,7 +3965,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3768"
+NAME="AEN3777"
></A
><H3
><A
@@ -3996,7 +4029,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3784"
+NAME="AEN3793"
></A
><H3
><A
@@ -4119,7 +4152,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3815"
+NAME="AEN3824"
></A
><H3
><A
@@ -4242,7 +4275,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3846"
+NAME="AEN3855"
></A
><H3
><A
@@ -4386,7 +4419,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3882"
+NAME="AEN3891"
></A
><H3
><A
@@ -4449,7 +4482,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3898"
+NAME="AEN3907"
></A
><H3
><A
@@ -4512,7 +4545,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3914"
+NAME="AEN3923"
></A
><H3
><A
@@ -4614,7 +4647,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3940"
+NAME="AEN3949"
></A
><H3
><A
@@ -4716,7 +4749,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3966"
+NAME="AEN3975"
></A
><H3
><A
@@ -4797,7 +4830,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN3987"
+NAME="AEN3996"
></A
><H3
><A
@@ -4897,7 +4930,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4012"
+NAME="AEN4021"
></A
><H3
><A
@@ -5067,7 +5100,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4053"
+NAME="AEN4062"
></A
><H3
><A
@@ -5222,7 +5255,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4091"
+NAME="AEN4100"
></A
><H3
><A
@@ -5336,7 +5369,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4119"
+NAME="AEN4128"
></A
><H3
><A
@@ -5512,7 +5545,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4161"
+NAME="AEN4170"
></A
><H3
><A
@@ -5673,7 +5706,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4200"
+NAME="AEN4209"
></A
><H3
><A
@@ -5775,7 +5808,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4226"
+NAME="AEN4235"
></A
><H3
><A
@@ -5856,7 +5889,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4247"
+NAME="AEN4256"
></A
><H3
><A
@@ -5958,7 +5991,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4273"
+NAME="AEN4282"
></A
><H3
><A
@@ -6079,7 +6112,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4303"
+NAME="AEN4312"
></A
><H3
><A
@@ -6178,7 +6211,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4328"
+NAME="AEN4337"
></A
><H3
><A
@@ -6280,7 +6313,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4354"
+NAME="AEN4363"
></A
><H3
><A
@@ -6361,7 +6394,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4375"
+NAME="AEN4384"
></A
><H3
><A
@@ -6481,7 +6514,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4405"
+NAME="AEN4414"
></A
><H3
><A
@@ -6583,7 +6616,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4431"
+NAME="AEN4440"
></A
><H3
><A
@@ -6682,7 +6715,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4456"
+NAME="AEN4465"
></A
><H3
><A
@@ -6763,7 +6796,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4477"
+NAME="AEN4486"
></A
><H3
><A
@@ -6844,7 +6877,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4498"
+NAME="AEN4507"
></A
><H3
><A
@@ -6922,7 +6955,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4518"
+NAME="AEN4527"
></A
><H3
><A
@@ -7029,7 +7062,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4545"
+NAME="AEN4554"
></A
><H3
><A
@@ -7136,7 +7169,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4572"
+NAME="AEN4581"
></A
><H3
><A
@@ -7199,7 +7232,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4588"
+NAME="AEN4597"
></A
><H3
><A
@@ -7301,7 +7334,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4614"
+NAME="AEN4623"
></A
><H3
><A
@@ -7408,7 +7441,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4640"
+NAME="AEN4649"
></A
><H3
><A
@@ -7472,7 +7505,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4656"
+NAME="AEN4665"
></A
><H3
><A
@@ -7535,7 +7568,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4672"
+NAME="AEN4681"
></A
><H3
><A
@@ -7666,7 +7699,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4704"
+NAME="AEN4713"
></A
><H3
><A
@@ -7790,7 +7823,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4735"
+NAME="AEN4744"
></A
><H3
><A
@@ -7894,7 +7927,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4761"
+NAME="AEN4770"
></A
><H3
><A
@@ -7978,7 +8011,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4782"
+NAME="AEN4791"
></A
><H3
><A
@@ -8059,7 +8092,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4803"
+NAME="AEN4812"
></A
><H3
><A
@@ -8140,7 +8173,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4824"
+NAME="AEN4833"
></A
><H3
><A
@@ -8263,7 +8296,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4855"
+NAME="AEN4864"
></A
><H3
><A
@@ -8295,7 +8328,12 @@
></TABLE
><P
>Search and get the value of an attribute associated to a node
-This does the entity substitution.</P
+This does the entity substitution.
+This function looks in DTD attribute declaration for <GTKDOCLINK
+HREF="FIXED"
+>FIXED</GTKDOCLINK
+> or
+default declaration values unless DTD use has been turned off.</P
><P
></P
><DIV
@@ -8367,7 +8405,138 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4881"
+NAME="AEN4891"
+></A
+><H3
+><A
+NAME="XMLGETNSPROP"
+></A
+>xmlGetNsProp ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-tree.html#XMLCHAR"
+>xmlChar</A
+>* xmlGetNsProp (<A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> node,
+ const <A
+HREF="gnome-xml-tree.html#XMLCHAR"
+>xmlChar</A
+> *name,
+ const <A
+HREF="gnome-xml-tree.html#XMLCHAR"
+>xmlChar</A
+> *namespace);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Search and get the value of an attribute associated to a node
+This attribute has to be anchored in the namespace specified.
+This does the entity substitution.
+This function looks in DTD attribute declaration for <GTKDOCLINK
+HREF="FIXED"
+>FIXED</GTKDOCLINK
+> or
+default declaration values unless DTD use has been turned off.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>node</I
+></TT
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+> the node</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>name</I
+></TT
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+> the attribute name</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>namespace</I
+></TT
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+> the URI of the namespace</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>the attribute value or NULL if not found.
+It's up to the caller to free the memory.</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN4923"
></A
><H3
><A
@@ -8470,7 +8639,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4907"
+NAME="AEN4949"
></A
><H3
><A
@@ -8591,7 +8760,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4937"
+NAME="AEN4979"
></A
><H3
><A
@@ -8712,7 +8881,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4967"
+NAME="AEN5009"
></A
><H3
><A
@@ -8796,7 +8965,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN4988"
+NAME="AEN5030"
></A
><H3
><A
@@ -8903,7 +9072,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5014"
+NAME="AEN5056"
></A
><H3
><A
@@ -8987,7 +9156,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5035"
+NAME="AEN5077"
></A
><H3
><A
@@ -9094,7 +9263,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5061"
+NAME="AEN5103"
></A
><H3
><A
@@ -9179,7 +9348,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5082"
+NAME="AEN5124"
></A
><H3
><A
@@ -9262,7 +9431,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5103"
+NAME="AEN5145"
></A
><H3
><A
@@ -9347,7 +9516,111 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5124"
+NAME="AEN5166"
+></A
+><H3
+><A
+NAME="XMLNODEGETBASE"
+></A
+>xmlNodeGetBase ()</H3
+><TABLE
+BORDER="0"
+BGCOLOR="#D6E8FF"
+WIDTH="100%"
+CELLPADDING="6"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+><A
+HREF="gnome-xml-tree.html#XMLCHAR"
+>xmlChar</A
+>* xmlNodeGetBase (<A
+HREF="gnome-xml-tree.html#XMLDOCPTR"
+>xmlDocPtr</A
+> doc,
+ <A
+HREF="gnome-xml-tree.html#XMLNODEPTR"
+>xmlNodePtr</A
+> cur);</PRE
+></TD
+></TR
+></TABLE
+><P
+>Searches for the BASE URL. The code should work on both XML
+and HTML document even if base mechanisms are completely different.</P
+><P
+></P
+><DIV
+CLASS="INFORMALTABLE"
+><P
+></P
+><TABLE
+BORDER="0"
+WIDTH="100%"
+BGCOLOR="#FFD0D0"
+CELLSPACING="0"
+CELLPADDING="4"
+CLASS="CALSTABLE"
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>doc</I
+></TT
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+> the document the node pertains to</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><TT
+CLASS="PARAMETER"
+><I
+>cur</I
+></TT
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+> the node being checked</TD
+></TR
+><TR
+><TD
+WIDTH="20%"
+ALIGN="RIGHT"
+VALIGN="TOP"
+><I
+CLASS="EMPHASIS"
+>Returns</I
+> :</TD
+><TD
+WIDTH="80%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>a pointer to the base URL, or NULL if not found
+It's up to the caller to free the memory.</TD
+></TR
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><HR><DIV
+CLASS="REFSECT2"
+><A
+NAME="AEN5192"
></A
><H3
><A
@@ -9423,7 +9696,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5143"
+NAME="AEN5211"
></A
><H3
><A
@@ -9499,7 +9772,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5162"
+NAME="AEN5230"
></A
><H3
><A
@@ -9584,7 +9857,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5183"
+NAME="AEN5251"
></A
><H3
><A
@@ -9666,7 +9939,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5203"
+NAME="AEN5271"
></A
><H3
><A
@@ -9752,7 +10025,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5224"
+NAME="AEN5292"
></A
><H3
><A
@@ -9855,7 +10128,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5249"
+NAME="AEN5317"
></A
><H3
><A
@@ -9939,7 +10212,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5270"
+NAME="AEN5338"
></A
><H3
><A
@@ -10042,7 +10315,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5295"
+NAME="AEN5363"
></A
><H3
><A
@@ -10120,7 +10393,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5315"
+NAME="AEN5383"
></A
><H3
><A
@@ -10202,7 +10475,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5335"
+NAME="AEN5403"
></A
><H3
><A
@@ -10260,7 +10533,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5350"
+NAME="AEN5418"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-valid.html b/doc/html/gnome-xml-valid.html
index 7486076..1824154 100644
--- a/doc/html/gnome-xml-valid.html
+++ b/doc/html/gnome-xml-valid.html
@@ -115,7 +115,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN5800"
+NAME="AEN5868"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN5803"
+NAME="AEN5871"
></A
><H2
>Synopsis</H2
@@ -809,7 +809,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN5986"
+NAME="AEN6054"
></A
><H2
>Description</H2
@@ -819,14 +819,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN5989"
+NAME="AEN6057"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN5991"
+NAME="AEN6059"
></A
><H3
><A
@@ -920,7 +920,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6013"
+NAME="AEN6081"
></A
><H3
><A
@@ -1014,7 +1014,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6035"
+NAME="AEN6103"
></A
><H3
><A
@@ -1040,7 +1040,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6040"
+NAME="AEN6108"
></A
><H3
><A
@@ -1066,7 +1066,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6045"
+NAME="AEN6113"
></A
><H3
><A
@@ -1092,7 +1092,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6050"
+NAME="AEN6118"
></A
><H3
><A
@@ -1118,7 +1118,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6055"
+NAME="AEN6123"
></A
><H3
><A
@@ -1144,7 +1144,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6060"
+NAME="AEN6128"
></A
><H3
><A
@@ -1170,7 +1170,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6065"
+NAME="AEN6133"
></A
><H3
><A
@@ -1196,7 +1196,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6070"
+NAME="AEN6138"
></A
><H3
><A
@@ -1222,7 +1222,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6075"
+NAME="AEN6143"
></A
><H3
><A
@@ -1248,7 +1248,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6080"
+NAME="AEN6148"
></A
><H3
><A
@@ -1274,7 +1274,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6085"
+NAME="AEN6153"
></A
><H3
><A
@@ -1439,7 +1439,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6126"
+NAME="AEN6194"
></A
><H3
><A
@@ -1520,7 +1520,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6147"
+NAME="AEN6215"
></A
><H3
><A
@@ -1583,7 +1583,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6163"
+NAME="AEN6231"
></A
><H3
><A
@@ -1667,7 +1667,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6184"
+NAME="AEN6252"
></A
><H3
><A
@@ -1769,7 +1769,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6210"
+NAME="AEN6278"
></A
><H3
><A
@@ -1850,7 +1850,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6231"
+NAME="AEN6299"
></A
><H3
><A
@@ -1913,7 +1913,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6247"
+NAME="AEN6315"
></A
><H3
><A
@@ -2078,7 +2078,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6288"
+NAME="AEN6356"
></A
><H3
><A
@@ -2159,7 +2159,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6309"
+NAME="AEN6377"
></A
><H3
><A
@@ -2222,7 +2222,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6325"
+NAME="AEN6393"
></A
><H3
><A
@@ -2306,7 +2306,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6346"
+NAME="AEN6414"
></A
><H3
><A
@@ -2388,7 +2388,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6367"
+NAME="AEN6435"
></A
><H3
><A
@@ -2451,7 +2451,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6383"
+NAME="AEN6451"
></A
><H3
><A
@@ -2533,7 +2533,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6404"
+NAME="AEN6472"
></A
><H3
><A
@@ -2761,7 +2761,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6460"
+NAME="AEN6528"
></A
><H3
><A
@@ -2842,7 +2842,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6481"
+NAME="AEN6549"
></A
><H3
><A
@@ -2905,7 +2905,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6497"
+NAME="AEN6565"
></A
><H3
><A
@@ -2989,7 +2989,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6518"
+NAME="AEN6586"
></A
><H3
><A
@@ -3133,7 +3133,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6554"
+NAME="AEN6622"
></A
><H3
><A
@@ -3212,7 +3212,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6574"
+NAME="AEN6642"
></A
><H3
><A
@@ -3275,7 +3275,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6590"
+NAME="AEN6658"
></A
><H3
><A
@@ -3377,7 +3377,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6616"
+NAME="AEN6684"
></A
><H3
><A
@@ -3499,7 +3499,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6646"
+NAME="AEN6714"
></A
><H3
><A
@@ -3643,7 +3643,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6682"
+NAME="AEN6750"
></A
><H3
><A
@@ -3722,7 +3722,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6702"
+NAME="AEN6770"
></A
><H3
><A
@@ -3785,7 +3785,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6718"
+NAME="AEN6786"
></A
><H3
><A
@@ -3907,7 +3907,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6748"
+NAME="AEN6816"
></A
><H3
><A
@@ -4010,7 +4010,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6773"
+NAME="AEN6841"
></A
><H3
><A
@@ -4135,7 +4135,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6803"
+NAME="AEN6871"
></A
><H3
><A
@@ -4262,7 +4262,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6834"
+NAME="AEN6902"
></A
><H3
><A
@@ -4376,7 +4376,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6863"
+NAME="AEN6931"
></A
><H3
><A
@@ -4500,7 +4500,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6893"
+NAME="AEN6961"
></A
><H3
><A
@@ -4622,7 +4622,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6924"
+NAME="AEN6992"
></A
><H3
><A
@@ -4725,7 +4725,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6950"
+NAME="AEN7018"
></A
><H3
><A
@@ -4845,7 +4845,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN6980"
+NAME="AEN7048"
></A
><H3
><A
@@ -4975,7 +4975,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7012"
+NAME="AEN7080"
></A
><H3
><A
@@ -5149,7 +5149,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7053"
+NAME="AEN7121"
></A
><H3
><A
@@ -5251,7 +5251,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7079"
+NAME="AEN7147"
></A
><H3
><A
@@ -5372,7 +5372,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7109"
+NAME="AEN7177"
></A
><H3
><A
@@ -5472,7 +5472,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7134"
+NAME="AEN7202"
></A
><H3
><A
@@ -5596,7 +5596,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7165"
+NAME="AEN7233"
></A
><H3
><A
@@ -5698,7 +5698,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7191"
+NAME="AEN7259"
></A
><H3
><A
@@ -5800,7 +5800,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7217"
+NAME="AEN7285"
></A
><H3
><A
@@ -5966,7 +5966,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7255"
+NAME="AEN7323"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-xml-error.html b/doc/html/gnome-xml-xml-error.html
index d64092c..f140d72 100644
--- a/doc/html/gnome-xml-xml-error.html
+++ b/doc/html/gnome-xml-xml-error.html
@@ -115,7 +115,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN7293"
+NAME="AEN7361"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN7296"
+NAME="AEN7364"
></A
><H2
>Synopsis</H2
@@ -187,7 +187,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN7308"
+NAME="AEN7376"
></A
><H2
>Description</H2
@@ -197,14 +197,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN7311"
+NAME="AEN7379"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7313"
+NAME="AEN7381"
></A
><H3
><A
@@ -341,7 +341,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7318"
+NAME="AEN7386"
></A
><H3
><A
@@ -438,7 +438,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7341"
+NAME="AEN7409"
></A
><H3
><A
@@ -535,7 +535,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7364"
+NAME="AEN7432"
></A
><H3
><A
@@ -632,7 +632,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7387"
+NAME="AEN7455"
></A
><H3
><A
@@ -729,7 +729,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7410"
+NAME="AEN7478"
></A
><H3
><A
@@ -792,7 +792,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7426"
+NAME="AEN7494"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-xmlmemory.html b/doc/html/gnome-xml-xmlmemory.html
index 3011eda..cc267fc 100644
--- a/doc/html/gnome-xml-xmlmemory.html
+++ b/doc/html/gnome-xml-xmlmemory.html
@@ -103,7 +103,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN10988"
+NAME="AEN11079"
></A
><H2
>Name</H2
@@ -111,7 +111,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN10991"
+NAME="AEN11082"
></A
><H2
>Synopsis</H2
@@ -210,7 +210,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN11012"
+NAME="AEN11103"
></A
><H2
>Description</H2
@@ -220,14 +220,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN11015"
+NAME="AEN11106"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11017"
+NAME="AEN11108"
></A
><H3
><A
@@ -253,7 +253,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11022"
+NAME="AEN11113"
></A
><H3
><A
@@ -316,7 +316,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11038"
+NAME="AEN11129"
></A
><H3
><A
@@ -382,7 +382,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11055"
+NAME="AEN11146"
></A
><H3
><A
@@ -466,7 +466,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11076"
+NAME="AEN11167"
></A
><H3
><A
@@ -544,7 +544,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11096"
+NAME="AEN11187"
></A
><H3
><A
@@ -602,7 +602,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11111"
+NAME="AEN11202"
></A
><H3
><A
@@ -660,7 +660,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11126"
+NAME="AEN11217"
></A
><H3
><A
@@ -688,7 +688,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11132"
+NAME="AEN11223"
></A
><H3
><A
@@ -752,7 +752,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11148"
+NAME="AEN11239"
></A
><H3
><A
@@ -778,7 +778,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11153"
+NAME="AEN11244"
></A
><H3
><A
@@ -804,7 +804,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11158"
+NAME="AEN11249"
></A
><H3
><A
@@ -830,7 +830,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11163"
+NAME="AEN11254"
></A
><H3
><A
@@ -935,7 +935,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11188"
+NAME="AEN11279"
></A
><H3
><A
@@ -1052,7 +1052,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN11216"
+NAME="AEN11307"
></A
><H3
><A
diff --git a/doc/html/gnome-xml-xpath.html b/doc/html/gnome-xml-xpath.html
index c43b240..9141f25 100644
--- a/doc/html/gnome-xml-xpath.html
+++ b/doc/html/gnome-xml-xpath.html
@@ -115,7 +115,7 @@
><DIV
CLASS="REFNAMEDIV"
><A
-NAME="AEN7881"
+NAME="AEN7949"
></A
><H2
>Name</H2
@@ -123,7 +123,7 @@
><DIV
CLASS="REFSYNOPSISDIV"
><A
-NAME="AEN7884"
+NAME="AEN7952"
></A
><H2
>Synopsis</H2
@@ -259,7 +259,7 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN7918"
+NAME="AEN7986"
></A
><H2
>Description</H2
@@ -269,14 +269,14 @@
><DIV
CLASS="REFSECT1"
><A
-NAME="AEN7921"
+NAME="AEN7989"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7923"
+NAME="AEN7991"
></A
><H3
><A
@@ -302,7 +302,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7928"
+NAME="AEN7996"
></A
><H3
><A
@@ -328,7 +328,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7933"
+NAME="AEN8001"
></A
><H3
><A
@@ -354,7 +354,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7938"
+NAME="AEN8006"
></A
><H3
><A
@@ -380,7 +380,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7943"
+NAME="AEN8011"
></A
><H3
><A
@@ -406,7 +406,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7948"
+NAME="AEN8016"
></A
><H3
><A
@@ -432,7 +432,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7953"
+NAME="AEN8021"
></A
><H3
><A
@@ -526,7 +526,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7976"
+NAME="AEN8044"
></A
><H3
><A
@@ -605,7 +605,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN7995"
+NAME="AEN8063"
></A
><H3
><A
@@ -705,7 +705,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8020"
+NAME="AEN8088"
></A
><H3
><A
@@ -784,7 +784,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8039"
+NAME="AEN8107"
></A
><H3
><A
@@ -865,7 +865,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8060"
+NAME="AEN8128"
></A
><H3
><A
@@ -928,7 +928,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8076"
+NAME="AEN8144"
></A
><H3
><A
@@ -1031,7 +1031,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8102"
+NAME="AEN8170"
></A
><H3
><A
@@ -1094,7 +1094,7 @@
><HR><DIV
CLASS="REFSECT2"
><A
-NAME="AEN8118"
+NAME="AEN8186"
></A
><H3
><A
diff --git a/doc/html/index.sgml b/doc/html/index.sgml
index 78554cb..b83f32c 100644
--- a/doc/html/index.sgml
+++ b/doc/html/index.sgml
@@ -216,6 +216,7 @@
<ANCHOR id ="XMLCOPYNAMESPACELIST" href="gnome-xml/gnome-xml-tree.html#XMLCOPYNAMESPACELIST">
<ANCHOR id ="XMLSETPROP" href="gnome-xml/gnome-xml-tree.html#XMLSETPROP">
<ANCHOR id ="XMLGETPROP" href="gnome-xml/gnome-xml-tree.html#XMLGETPROP">
+<ANCHOR id ="XMLGETNSPROP" href="gnome-xml/gnome-xml-tree.html#XMLGETNSPROP">
<ANCHOR id ="XMLSTRINGGETNODELIST" href="gnome-xml/gnome-xml-tree.html#XMLSTRINGGETNODELIST">
<ANCHOR id ="XMLSTRINGLENGETNODELIST" href="gnome-xml/gnome-xml-tree.html#XMLSTRINGLENGETNODELIST">
<ANCHOR id ="XMLNODELISTGETSTRING" href="gnome-xml/gnome-xml-tree.html#XMLNODELISTGETSTRING">
@@ -226,6 +227,7 @@
<ANCHOR id ="XMLNODEGETCONTENT" href="gnome-xml/gnome-xml-tree.html#XMLNODEGETCONTENT">
<ANCHOR id ="XMLNODEGETLANG" href="gnome-xml/gnome-xml-tree.html#XMLNODEGETLANG">
<ANCHOR id ="XMLNODESETLANG" href="gnome-xml/gnome-xml-tree.html#XMLNODESETLANG">
+<ANCHOR id ="XMLNODEGETBASE" href="gnome-xml/gnome-xml-tree.html#XMLNODEGETBASE">
<ANCHOR id ="XMLREMOVEPROP" href="gnome-xml/gnome-xml-tree.html#XMLREMOVEPROP">
<ANCHOR id ="XMLREMOVENODE" href="gnome-xml/gnome-xml-tree.html#XMLREMOVENODE">
<ANCHOR id ="XMLBUFFERWRITECHAR" href="gnome-xml/gnome-xml-tree.html#XMLBUFFERWRITECHAR">
@@ -495,6 +497,7 @@
<ANCHOR id ="XMLDEBUGDUMPNODE" href="gnome-xml/gnome-xml-debugxml.html#XMLDEBUGDUMPNODE">
<ANCHOR id ="XMLDEBUGDUMPNODELIST" href="gnome-xml/gnome-xml-debugxml.html#XMLDEBUGDUMPNODELIST">
<ANCHOR id ="XMLDEBUGDUMPDOCUMENT" href="gnome-xml/gnome-xml-debugxml.html#XMLDEBUGDUMPDOCUMENT">
+<ANCHOR id ="XMLDEBUGDUMPENTITIES" href="gnome-xml/gnome-xml-debugxml.html#XMLDEBUGDUMPENTITIES">
<ANCHOR id ="GNOME-XML-XMLMEMORY" href="gnome-xml/gnome-xml-xmlmemory.html">
<ANCHOR id ="NO-DEBUG-MEMORY" href="gnome-xml/gnome-xml-xmlmemory.html#NO-DEBUG-MEMORY">
<ANCHOR id ="XMLFREE" href="gnome-xml/gnome-xml-xmlmemory.html#XMLFREE">
diff --git a/doc/xml.html b/doc/xml.html
index bfdaa99..e0e286f 100644
--- a/doc/xml.html
+++ b/doc/xml.html
Binary files differ
diff --git a/include/libxml/SAX.h b/include/libxml/SAX.h
index 8d9f3c7..0424fa7 100644
--- a/include/libxml/SAX.h
+++ b/include/libxml/SAX.h
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
+#include "xlink.h"
#ifndef __XML_SAX_H__
#define __XML_SAX_H__
diff --git a/include/libxml/debugXML.h b/include/libxml/debugXML.h
index f73527c..b24219a 100644
--- a/include/libxml/debugXML.h
+++ b/include/libxml/debugXML.h
@@ -16,4 +16,5 @@
extern void xmlDebugDumpNode(FILE *output, xmlNodePtr node, int depth);
extern void xmlDebugDumpNodeList(FILE *output, xmlNodePtr node, int depth);
extern void xmlDebugDumpDocument(FILE *output, xmlDocPtr doc);
+extern void xmlDebugDumpEntities(FILE *output, xmlDocPtr doc);
#endif /* __DEBUG_XML__ */
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 20a64df..e046073 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -112,6 +112,7 @@
xmlAttributeDefault def; /* the default */
const xmlChar *defaultValue;/* or the default value */
xmlEnumerationPtr tree; /* or the enumeration tree if any */
+ const xmlChar *prefix; /* the namespace prefix if any */
} xmlAttribute;
typedef xmlAttribute *xmlAttributePtr;
@@ -462,6 +463,9 @@
const xmlChar *value);
xmlChar * xmlGetProp (xmlNodePtr node,
const xmlChar *name);
+xmlChar * xmlGetNsProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *namespace);
xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
const xmlChar *value);
xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
@@ -484,6 +488,8 @@
xmlChar * xmlNodeGetLang (xmlNodePtr cur);
void xmlNodeSetLang (xmlNodePtr cur,
const xmlChar *lang);
+xmlChar * xmlNodeGetBase (xmlDocPtr doc,
+ xmlNodePtr cur);
/*
* Removing content.
diff --git a/include/libxml/xlink.h b/include/libxml/xlink.h
new file mode 100644
index 0000000..7d1025f
--- /dev/null
+++ b/include/libxml/xlink.h
@@ -0,0 +1,175 @@
+/*
+ * xlink.h : interfaces to the hyperlinks detection module
+ *
+ * See Copyright for the status of this software.
+ *
+ * Related specification: http://www.w3.org/TR/xlink
+ * http://www.w3.org/HTML/
+ * and XBase
+ *
+ * Daniel.Veillard@w3.org
+ */
+
+#ifndef __XML_XLINK_H__
+#define __XML_XLINK_H__
+
+#include "tree.h"
+
+/**
+ * Various defines for the various Link properties.
+ *
+ * NOTE: the link detection layer will try to resolve QName expansion
+ * of namespaces, if "foo" is the prefix for "http://foo.com/"
+ * then the link detection layer will expand role="foo:myrole"
+ * to "http://foo.com/:myrole"
+ * NOTE: the link detection layer will expand URI-Refences found on
+ * href attributes by using the base mechanism if found.
+ */
+typedef xmlChar *xlinkHRef;
+typedef xmlChar *xlinkRole;
+typedef xmlChar *xlinkTitle;
+
+typedef enum {
+ XLINK_TYPE_NONE = 0,
+ XLINK_TYPE_SIMPLE,
+ XLINK_TYPE_EXTENDED,
+ XLINK_TYPE_EXTENDED_SET
+} xlinkType;
+
+typedef enum {
+ XLINK_SHOW_NONE = 0,
+ XLINK_SHOW_NEW,
+ XLINK_SHOW_EMBED,
+ XLINK_SHOW_REPLACE
+} xlinkShow;
+
+typedef enum {
+ XLINK_ACTUATE_NONE = 0,
+ XLINK_ACTUATE_AUTO,
+ XLINK_ACTUATE_ONREQUEST
+} xlinkActuate;
+
+/**
+ * xlinkNodeDetectFunc:
+ * @ctx: user data pointer
+ * @node: the node to check
+ *
+ * This is the prototype for the link detection routine
+ * It calls the default link detection callbacks upon link detection.
+ */
+typedef void
+(*xlinkNodeDetectFunc) (void *ctx,
+ xmlNodePtr node);
+
+/**
+ * The link detection module interract with the upper layers using
+ * a set of callback registered at parsing time.
+ */
+
+/**
+ * xlinkSimpleLinkFunk:
+ * @ctx: user data pointer
+ * @node: the node carrying the link
+ * @href: the target of the link
+ * @role: the role string
+ * @title: the link title
+ *
+ * This is the prototype for a simple link detection callback.
+ */
+typedef void
+(*xlinkSimpleLinkFunk) (void *ctx,
+ xmlNodePtr node,
+ const xlinkHRef href,
+ const xlinkRole role,
+ const xlinkTitle title);
+
+/**
+ * xlinkExtendedLinkFunk:
+ * @ctx: user data pointer
+ * @node: the node carrying the link
+ * @nbLocators: the number of locators detected on the link
+ * @hrefs: pointer to the array of locator hrefs
+ * @roles: pointer to the array of locator roles
+ * @nbArcs: the number of arcs detected on the link
+ * @from: pointer to the array of source roles found on the arcs
+ * @to: pointer to the array of target roles found on the arcs
+ * @show: array of values for the show attributes found on the arcs
+ * @actuate: array of values for the actuate attributes found on the arcs
+ * @nbTitles: the number of titles detected on the link
+ * @title: array of titles detected on the link
+ * @langs: array of xml:lang values for the titles
+ *
+ * This is the prototype for a extended link detection callback.
+ */
+typedef void
+(*xlinkExtendedLinkFunk)(void *ctx,
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbArcs,
+ const xlinkRole *from,
+ const xlinkRole *to,
+ xlinkShow *show,
+ xlinkActuate *actuate,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
+
+/**
+ * xlinkExtendedLinkSetFunk:
+ * @ctx: user data pointer
+ * @node: the node carrying the link
+ * @nbLocators: the number of locators detected on the link
+ * @hrefs: pointer to the array of locator hrefs
+ * @roles: pointer to the array of locator roles
+ * @nbTitles: the number of titles detected on the link
+ * @title: array of titles detected on the link
+ * @langs: array of xml:lang values for the titles
+ *
+ * This is the prototype for a extended link set detection callback.
+ */
+typedef void
+(*xlinkExtendedLinkSetFunk) (void *ctx,
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
+
+/**
+ * This is the structure containing a set of Links detection callbacks
+ *
+ * There is no default xlink callbacks, if one want to get link
+ * recognition activated, those call backs must be provided before parsing.
+ */
+typedef struct xlinkHandler {
+ xlinkSimpleLinkFunk simple;
+ xlinkExtendedLinkFunk extended;
+ xlinkExtendedLinkSetFunk set;
+} xlinkHandler;
+typedef xlinkHandler *xlinkHandlerPtr;
+
+/**
+ * the default detection routine, can be overriden, they call the default
+ * detection callbacks.
+ */
+
+xlinkNodeDetectFunc xlinkGetDefaultDetect (void);
+void xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
+
+/**
+ * Routines to set/get the default handlers.
+ */
+xlinkHandlerPtr xlinkGetDefaultHandler (void);
+void xlinkSetDefaultHandler (xlinkHandlerPtr handler);
+
+/*
+ * Link detection module itself.
+ */
+xlinkType xlinkIsLink (xmlDocPtr doc,
+ xmlNodePtr node);
+
+#endif /* __XML_XLINK_H__ */
diff --git a/parser.c b/parser.c
index e543c38..eef4721 100644
--- a/parser.c
+++ b/parser.c
@@ -164,6 +164,13 @@
return(0);
}
ret = xmlParserInputBufferGrow(in->buf, len);
+
+ /*
+ * NOTE : in->base may be a "dandling" i.e. freed pointer in this
+ * block, but we use it really as an integer to do some
+ * pointer arithmetic. Insure will raise it as a bug but in
+ * that specific case, that's not !
+ */
if (in->base != in->buf->buffer->content) {
/*
* the buffer has been realloced
@@ -235,6 +242,8 @@
int xmlSubstituteEntitiesDefaultValue = 0;
int xmlDoValidityCheckingDefaultValue = 0;
+xmlEntityPtr xmlParseStringEntityRef(xmlParserCtxtPtr ctxt,
+ const xmlChar ** str);
/*
* Generic function for accessing stacks in the Parser Context
@@ -298,7 +307,7 @@
*/
#define CUR (ctxt->token ? ctxt->token : (*ctxt->input->cur))
-#define SKIP(val) ctxt->input->cur += (val)
+#define SKIP(val) ctxt->nbChars += (val),ctxt->input->cur += (val)
#define NXT(val) ctxt->input->cur[(val)]
#define CUR_PTR ctxt->input->cur
#define SHRINK xmlParserInputShrink(ctxt->input); \
@@ -330,6 +339,7 @@
ctxt->input->line++; ctxt->input->col = 1; \
} else ctxt->input->col++; \
ctxt->input->cur++; \
+ ctxt->nbChars++; \
if (*ctxt->input->cur == 0) \
xmlParserInputGrow(ctxt->input, INPUT_CHUNK); \
} \
@@ -646,6 +656,7 @@
ctxt->vctxt.warning = xmlParserValidityWarning;
ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
ctxt->record_info = 0;
+ ctxt->nbChars = 0;
xmlInitNodeInfoSeq(&ctxt->node_seq);
}
@@ -723,6 +734,8 @@
void xmlParserHandleReference(xmlParserCtxtPtr ctxt);
void xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
+xmlEntityPtr xmlParseStringPEReference(xmlParserCtxtPtr ctxt,
+ const xmlChar **str);
/**
* xmlParseCharRef:
@@ -737,7 +750,7 @@
* Characters referred to using character references must match the
* production for Char.
*
- * Returns the value parsed (as an int)
+ * Returns the value parsed (as an int), 0 in case of error
*/
int
xmlParseCharRef(xmlParserCtxtPtr ctxt) {
@@ -816,6 +829,104 @@
}
/**
+ * xmlParseStringCharRef:
+ * @ctxt: an XML parser context
+ * @str: a pointer to an index in the string
+ *
+ * parse Reference declarations, variant parsing from a string rather
+ * than an an input flow.
+ *
+ * [66] CharRef ::= '&#' [0-9]+ ';' |
+ * '&#x' [0-9a-fA-F]+ ';'
+ *
+ * [ WFC: Legal Character ]
+ * Characters referred to using character references must match the
+ * production for Char.
+ *
+ * Returns the value parsed (as an int), 0 in case of error, str will be
+ * updated to the current value of the index
+ */
+int
+xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
+ const xmlChar *ptr;
+ xmlChar cur;
+ int val = 0;
+
+ if ((str == NULL) || (*str == NULL)) return(0);
+ ptr = *str;
+ cur = *ptr;
+ if ((cur = '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {
+ ptr += 3;
+ cur = *ptr;
+ while (cur != ';') {
+ if ((cur >= '0') && (cur <= '9'))
+ val = val * 16 + (cur - '0');
+ else if ((cur >= 'a') && (cur <= 'f'))
+ val = val * 16 + (cur - 'a') + 10;
+ else if ((cur >= 'A') && (cur <= 'F'))
+ val = val * 16 + (cur - 'A') + 10;
+ else {
+ ctxt->errNo = XML_ERR_INVALID_HEX_CHARREF;
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseCharRef: invalid hexadecimal value\n");
+ ctxt->wellFormed = 0;
+ val = 0;
+ break;
+ }
+ ptr++;
+ cur = *ptr;
+ }
+ if (cur == ';')
+ ptr++;
+ } else if ((cur = '&') && (ptr[1] == '#')){
+ ptr += 2;
+ cur = *ptr;
+ while (cur != ';') {
+ if ((cur >= '0') && (cur <= '9'))
+ val = val * 10 + (cur - '0');
+ else {
+ ctxt->errNo = XML_ERR_INVALID_DEC_CHARREF;
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseCharRef: invalid decimal value\n");
+ ctxt->wellFormed = 0;
+ val = 0;
+ break;
+ }
+ ptr++;
+ cur = *ptr;
+ }
+ if (cur == ';')
+ ptr++;
+ } else {
+ ctxt->errNo = XML_ERR_INVALID_CHARREF;
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseCharRef: invalid value\n");
+ ctxt->wellFormed = 0;
+ return(0);
+ }
+ *str = ptr;
+
+ /*
+ * [ WFC: Legal Character ]
+ * Characters referred to using character references must match the
+ * production for Char.
+ */
+ if (IS_CHAR(val)) {
+ return(val);
+ } else {
+ ctxt->errNo = XML_ERR_INVALID_CHAR;
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "CharRef: invalid xmlChar value %d\n", val);
+ ctxt->wellFormed = 0;
+ }
+ return(0);
+}
+
+/**
* xmlParserHandleReference:
* @ctxt: the parser context
*
@@ -1323,6 +1434,116 @@
return(buffer);
}
+/**
+ * xmlStringDecodeEntities:
+ * @ctxt: the parser context
+ * @str: the input string
+ * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
+ * @end: an end marker xmlChar, 0 if none
+ * @end2: an end marker xmlChar, 0 if none
+ * @end3: an end marker xmlChar, 0 if none
+ *
+ * [67] Reference ::= EntityRef | CharRef
+ *
+ * [69] PEReference ::= '%' Name ';'
+ *
+ * Returns A newly allocated string with the substitution done. The caller
+ * must deallocate it !
+ */
+xmlChar *
+xmlStringDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int what,
+ xmlChar end, xmlChar end2, xmlChar end3) {
+ xmlChar *buffer = NULL;
+ int buffer_size = 0;
+ xmlChar *out = NULL;
+
+ xmlChar *current = NULL;
+ xmlEntityPtr ent;
+ xmlChar cur;
+
+ /*
+ * allocate a translation buffer.
+ */
+ buffer_size = 500;
+ buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
+ if (buffer == NULL) {
+ perror("xmlDecodeEntities: malloc failed");
+ return(NULL);
+ }
+ out = buffer;
+
+ /*
+ * Ok loop until we reach one of the ending char or a size limit.
+ */
+ cur = *str;
+ while ((cur != 0) && (cur != end) &&
+ (cur != end2) && (cur != end3)) {
+
+ if (cur == 0) break;
+ if ((cur == '&') && (str[1] == '#')) {
+ int val = xmlParseStringCharRef(ctxt, &str);
+ if (val != 0)
+ *out++ = val;
+ } else if ((cur == '&') && (what & XML_SUBSTITUTE_REF)) {
+ ent = xmlParseStringEntityRef(ctxt, &str);
+ if ((ent != NULL) &&
+ (ctxt->replaceEntities != 0)) {
+ current = ent->content;
+ while (*current != 0) {
+ *out++ = *current++;
+ if (out - buffer > buffer_size - 100) {
+ int index = out - buffer;
+
+ growBuffer(buffer);
+ out = &buffer[index];
+ }
+ }
+ } else if (ent != NULL) {
+ int i = xmlStrlen(ent->name);
+ const xmlChar *cur = ent->name;
+
+ *out++ = '&';
+ if (out - buffer > buffer_size - i - 100) {
+ int index = out - buffer;
+
+ growBuffer(buffer);
+ out = &buffer[index];
+ }
+ for (;i > 0;i--)
+ *out++ = *cur++;
+ *out++ = ';';
+ }
+ } else if (cur == '%' && (what & XML_SUBSTITUTE_PEREF)) {
+ ent = xmlParseStringPEReference(ctxt, &str);
+ if (ent != NULL) {
+ current = ent->content;
+ while (*current != 0) {
+ *out++ = *current++;
+ if (out - buffer > buffer_size - 100) {
+ int index = out - buffer;
+
+ growBuffer(buffer);
+ out = &buffer[index];
+ }
+ }
+ }
+ } else {
+ /* invalid for UTF-8 , use COPY(out); !!!!!! */
+ *out++ = cur;
+ if (out - buffer > buffer_size - 100) {
+ int index = out - buffer;
+
+ growBuffer(buffer);
+ out = &buffer[index];
+ }
+ str++;
+ }
+ cur = *str;
+ }
+ *out = 0;
+ return(buffer);
+}
+
/************************************************************************
* *
@@ -1494,8 +1715,10 @@
*/
xmlChar *
xmlStrndup(const xmlChar *cur, int len) {
- xmlChar *ret = xmlMalloc((len + 1) * sizeof(xmlChar));
-
+ xmlChar *ret;
+
+ if ((cur == NULL) || (len < 0)) return(NULL);
+ ret = xmlMalloc((len + 1) * sizeof(xmlChar));
if (ret == NULL) {
fprintf(stderr, "malloc of %ld byte failed\n",
(len + 1) * (long)sizeof(xmlChar));
@@ -1518,6 +1741,7 @@
xmlStrdup(const xmlChar *cur) {
const xmlChar *p = cur;
+ if (cur == NULL) return(NULL);
while (IS_CHAR(*p)) p++;
return(xmlStrndup(cur, p - cur));
}
@@ -1535,8 +1759,10 @@
xmlChar *
xmlCharStrndup(const char *cur, int len) {
int i;
- xmlChar *ret = xmlMalloc((len + 1) * sizeof(xmlChar));
-
+ xmlChar *ret;
+
+ if ((cur == NULL) || (len < 0)) return(NULL);
+ ret = xmlMalloc((len + 1) * sizeof(xmlChar));
if (ret == NULL) {
fprintf(stderr, "malloc of %ld byte failed\n",
(len + 1) * (long)sizeof(xmlChar));
@@ -1562,6 +1788,7 @@
xmlCharStrdup(const char *cur) {
const char *p = cur;
+ if (cur == NULL) return(NULL);
while (*p != '\0') p++;
return(xmlCharStrndup(cur, p - cur));
}
@@ -1580,6 +1807,9 @@
xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
register int tmp;
+ if ((str1 == NULL) && (str2 == NULL)) return(0);
+ if (str1 == NULL) return(-1);
+ if (str2 == NULL) return(1);
do {
tmp = *str1++ - *str2++;
if (tmp != 0) return(tmp);
@@ -1603,6 +1833,9 @@
register int tmp;
if (len <= 0) return(0);
+ if ((str1 == NULL) && (str2 == NULL)) return(0);
+ if (str1 == NULL) return(-1);
+ if (str2 == NULL) return(1);
do {
tmp = *str1++ - *str2++;
if (tmp != 0) return(tmp);
@@ -1624,6 +1857,7 @@
const xmlChar *
xmlStrchr(const xmlChar *str, xmlChar val) {
+ if (str == NULL) return(NULL);
while (*str != 0) {
if (*str == val) return((xmlChar *) str);
str++;
@@ -2041,37 +2275,68 @@
*/
xmlChar *
xmlParseQuotedString(xmlParserCtxtPtr ctxt) {
- xmlChar *ret = NULL;
- const xmlChar *q;
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 100;
+ xmlChar c;
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return(NULL);
+ }
if (CUR == '"') {
NEXT;
- q = CUR_PTR;
- while (IS_CHAR(CUR) && (CUR != '"')) NEXT;
- if (CUR != '"') {
+ c = CUR;
+ while (IS_CHAR(c) && (c != '"')) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ }
+ buf[len++] = c;
+ NEXT;
+ c = CUR;
+ }
+ if (c != '"') {
ctxt->errNo = XML_ERR_STRING_NOT_CLOSED;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "String not closed \"%.50s\"\n", q);
+ ctxt->sax->error(ctxt->userData,
+ "String not closed \"%.50s\"\n", buf);
ctxt->wellFormed = 0;
} else {
- ret = xmlStrndup(q, CUR_PTR - q);
NEXT;
}
} else if (CUR == '\''){
NEXT;
- q = CUR_PTR;
- while (IS_CHAR(CUR) && (CUR != '\'')) NEXT;
+ c = CUR;
+ while (IS_CHAR(c) && (c != '\'')) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ }
+ buf[len++] = c;
+ NEXT;
+ c = CUR;
+ }
if (CUR != '\'') {
ctxt->errNo = XML_ERR_STRING_NOT_CLOSED;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "String not closed \"%.50s\"\n", q);
+ ctxt->sax->error(ctxt->userData,
+ "String not closed \"%.50s\"\n", buf);
ctxt->wellFormed = 0;
} else {
- ret = xmlStrndup(q, CUR_PTR - q);
NEXT;
}
}
- return(ret);
+ return(buf);
}
/**
@@ -2294,6 +2559,51 @@
}
/**
+ * xmlParseStringName:
+ * @ctxt: an XML parser context
+ * @str: a pointer to an index in the string
+ *
+ * parse an XML name.
+ *
+ * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
+ * CombiningChar | Extender
+ *
+ * [5] Name ::= (Letter | '_' | ':') (NameChar)*
+ *
+ * [6] Names ::= Name (S Name)*
+ *
+ * Returns the Name parsed or NULL. The str pointer
+ * is updated to the current location in the string.
+ */
+
+xmlChar *
+xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
+ const xmlChar *ptr;
+ const xmlChar *start;
+ xmlChar cur;
+
+ if ((str == NULL) || (*str == NULL)) return(NULL);
+
+ start = ptr = *str;
+ cur = *ptr;
+ if (!IS_LETTER(cur) && (cur != '_') &&
+ (cur != ':')) {
+ return(NULL);
+ }
+
+ while ((IS_LETTER(cur)) || (IS_DIGIT(cur)) ||
+ (cur == '.') || (cur == '-') ||
+ (cur == '_') || (cur == ':') ||
+ (IS_COMBINING(cur)) ||
+ (IS_EXTENDER(cur))) {
+ ptr++;
+ cur = *ptr;
+ }
+ *str = ptr;
+ return(xmlStrndup(start, ptr - start ));
+}
+
+/**
* xmlParseNmtoken:
* @ctxt: an XML parser context
*
@@ -2349,138 +2659,93 @@
xmlChar *
xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) {
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 100;
+ xmlChar c;
+ xmlChar stop;
xmlChar *ret = NULL;
- const xmlChar *org = NULL;
- const xmlChar *tst = NULL;
- const xmlChar *temp = NULL;
xmlParserInputPtr input;
- SHRINK;
- if (CUR == '"') {
- ctxt->instate = XML_PARSER_ENTITY_VALUE;
- input = ctxt->input;
- NEXT;
- org = CUR_PTR;
- /*
- * NOTE: 4.4.5 Included in Literal
- * When a parameter entity reference appears in a literal entity
- * value, ... a single or double quote character in the replacement
- * text is always treated as a normal data character and will not
- * terminate the literal.
- * In practice it means we stop the loop only when back at parsing
- * the initial entity and the quote is found
- */
- while ((CUR != '"') || (ctxt->input != input)) {
- tst = CUR_PTR;
- /*
- * NOTE: 4.4.7 Bypassed
- * When a general entity reference appears in the EntityValue in
- * an entity declaration, it is bypassed and left as is.
- * so XML_SUBSTITUTE_REF is not set.
- */
- if (ctxt->input != input)
- temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_PEREF,
- 0, 0, 0);
- else
- temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_PEREF,
- '"', 0, 0);
-
- /*
- * Pop-up of finished entities.
- */
- while ((CUR == 0) && (ctxt->inputNr > 1))
- xmlPopInput(ctxt);
-
- if ((temp == NULL) && (tst == CUR_PTR)) {
- ret = xmlStrndup((xmlChar *) "", 0);
- break;
- }
- if ((temp[0] == 0) && (tst == CUR_PTR)) {
- xmlFree((char *)temp);
- ret = xmlStrndup((xmlChar *) "", 0);
- break;
- }
- ret = xmlStrcat(ret, temp);
- if (temp != NULL) xmlFree((char *)temp);
- GROW;
- }
- if (CUR != '"') {
- ctxt->errNo = XML_ERR_ENTITY_NOT_FINISHED;
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "EntityValue: \" expected\n");
- ctxt->wellFormed = 0;
- } else {
- if (orig != NULL) /* !!!!!!!!! */
- *orig = xmlStrndup(org, CUR_PTR - org);
- if (ret == NULL)
- ret = xmlStrndup((xmlChar *) "", 0);
- NEXT;
- }
- } else if (CUR == '\'') {
- ctxt->instate = XML_PARSER_ENTITY_VALUE;
- input = ctxt->input;
- NEXT;
- org = CUR_PTR;
- /*
- * NOTE: 4.4.5 Included in Literal
- * When a parameter entity reference appears in a literal entity
- * value, ... a single or double quote character in the replacement
- * text is always treated as a normal data character and will not
- * terminate the literal.
- * In practice it means we stop the loop only when back at parsing
- * the initial entity and the quote is found
- */
- while ((CUR != '\'') || (ctxt->input != input)) {
- tst = CUR_PTR;
- /*
- * NOTE: 4.4.7 Bypassed
- * When a general entity reference appears in the EntityValue in
- * an entity declaration, it is bypassed and left as is.
- * so XML_SUBSTITUTE_REF is not set.
- */
- if (ctxt->input != input)
- temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_PEREF,
- 0, 0, 0);
- else
- temp = xmlDecodeEntities(ctxt, -1, XML_SUBSTITUTE_PEREF,
- '\'', 0, 0);
-
- /*
- * Pop-up of finished entities.
- */
- while ((CUR == 0) && (ctxt->inputNr > 1))
- xmlPopInput(ctxt);
-
- if ((temp == NULL) && (tst == CUR_PTR)) {
- ret = xmlStrndup((xmlChar *) "", 0);
- break;
- }
- if ((temp[0] == 0) && (tst == CUR_PTR)) {
- xmlFree((char *)temp);
- ret = xmlStrndup((xmlChar *) "", 0);
- break;
- }
- ret = xmlStrcat(ret, temp);
- if (temp != NULL) xmlFree((char *)temp);
- GROW;
- }
- if (CUR != '\'') {
- ctxt->errNo = XML_ERR_ENTITY_NOT_FINISHED;
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "EntityValue: ' expected\n");
- ctxt->wellFormed = 0;
- } else {
- if (orig != NULL) /* !!!!!!!!! */
- *orig = xmlStrndup(org, CUR_PTR - org);
- if (ret == NULL)
- ret = xmlStrndup((xmlChar *) "", 0);
- NEXT;
- }
- } else {
+ if (CUR == '"') stop = '"';
+ else if (CUR == '\'') stop = '\'';
+ else {
ctxt->errNo = XML_ERR_ENTITY_NOT_STARTED;
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData, "EntityValue: \" or ' expected\n");
ctxt->wellFormed = 0;
+ return(NULL);
+ }
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return(NULL);
+ }
+
+ /*
+ * The content of the entity definition is copied in a buffer.
+ */
+
+ ctxt->instate = XML_PARSER_ENTITY_VALUE;
+ input = ctxt->input;
+ GROW;
+ NEXT;
+ c = CUR;
+ /*
+ * NOTE: 4.4.5 Included in Literal
+ * When a parameter entity reference appears in a literal entity
+ * value, ... a single or double quote character in the replacement
+ * text is always treated as a normal data character and will not
+ * terminate the literal.
+ * In practice it means we stop the loop only when back at parsing
+ * the initial entity and the quote is found
+ */
+ while (IS_CHAR(c) && ((c != stop) || (ctxt->input != input))) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ }
+ buf[len++] = c;
+ NEXT;
+ /*
+ * Pop-up of finished entities.
+ */
+ while ((CUR == 0) && (ctxt->inputNr > 1))
+ xmlPopInput(ctxt);
+ c = CUR;
+ if (c == 0) {
+ GROW;
+ c = CUR;
+ }
+ }
+ buf[len] = 0;
+
+ /*
+ * Then PEReference entities are substituted.
+ */
+ if (c != stop) {
+ ctxt->errNo = XML_ERR_ENTITY_NOT_FINISHED;
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "EntityValue: \" expected\n");
+ ctxt->wellFormed = 0;
+ } else {
+ NEXT;
+ /*
+ * NOTE: 4.4.7 Bypassed
+ * When a general entity reference appears in the EntityValue in
+ * an entity declaration, it is bypassed and left as is.
+ * so XML_SUBSTITUTE_REF is not set.
+ */
+ ret = xmlStringDecodeEntities(ctxt, buf, XML_SUBSTITUTE_PEREF,
+ 0, 0, 0);
+ if (orig != NULL)
+ *orig = buf;
+ else
+ xmlFree(buf);
}
return(ret);
@@ -2651,47 +2916,62 @@
xmlChar *
xmlParseSystemLiteral(xmlParserCtxtPtr ctxt) {
- const xmlChar *q;
- xmlChar *ret = NULL;
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 100;
+ xmlChar cur;
+ xmlChar stop;
SHRINK;
if (CUR == '"') {
NEXT;
- q = CUR_PTR;
- while ((IS_CHAR(CUR)) && (CUR != '"'))
- NEXT;
- if (!IS_CHAR(CUR)) {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "Unfinished SystemLiteral\n");
- ctxt->errNo = XML_ERR_LITERAL_NOT_FINISHED;
- ctxt->wellFormed = 0;
- } else {
- ret = xmlStrndup(q, CUR_PTR - q);
- NEXT;
- }
+ stop = '"';
} else if (CUR == '\'') {
NEXT;
- q = CUR_PTR;
- while ((IS_CHAR(CUR)) && (CUR != '\''))
- NEXT;
- if (!IS_CHAR(CUR)) {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "Unfinished SystemLiteral\n");
- ctxt->errNo = XML_ERR_LITERAL_NOT_FINISHED;
- ctxt->wellFormed = 0;
- } else {
- ret = xmlStrndup(q, CUR_PTR - q);
- NEXT;
- }
+ stop = '\'';
} else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"SystemLiteral \" or ' expected\n");
ctxt->errNo = XML_ERR_LITERAL_NOT_STARTED;
ctxt->wellFormed = 0;
+ return(NULL);
}
- return(ret);
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ cur = CUR;
+ while ((IS_CHAR(cur)) && (cur != stop)) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ }
+ buf[len++] = cur;
+ NEXT;
+ cur = CUR;
+ if (cur == 0) {
+ GROW;
+ SHRINK;
+ cur = CUR;
+ }
+ }
+ buf[len] = 0;
+ if (!IS_CHAR(cur)) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "Unfinished SystemLiteral\n");
+ ctxt->errNo = XML_ERR_LITERAL_NOT_FINISHED;
+ ctxt->wellFormed = 0;
+ } else {
+ NEXT;
+ }
+ return(buf);
}
/**
@@ -2707,45 +2987,61 @@
xmlChar *
xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
- const xmlChar *q;
- xmlChar *ret = NULL;
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 100;
+ xmlChar cur;
+ xmlChar stop;
SHRINK;
if (CUR == '"') {
NEXT;
- q = CUR_PTR;
- while (IS_PUBIDCHAR(CUR)) NEXT;
- if (CUR != '"') {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
- ctxt->errNo = XML_ERR_LITERAL_NOT_FINISHED;
- ctxt->wellFormed = 0;
- } else {
- ret = xmlStrndup(q, CUR_PTR - q);
- NEXT;
- }
+ stop = '"';
} else if (CUR == '\'') {
NEXT;
- q = CUR_PTR;
- while (IS_PUBIDCHAR(CUR)) NEXT;
- if (CUR != '\'') {
- if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
- ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
- ctxt->errNo = XML_ERR_LITERAL_NOT_FINISHED;
- ctxt->wellFormed = 0;
- } else {
- ret = xmlStrndup(q, CUR_PTR - q);
- NEXT;
- }
+ stop = '\'';
} else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"SystemLiteral \" or ' expected\n");
ctxt->errNo = XML_ERR_LITERAL_NOT_STARTED;
ctxt->wellFormed = 0;
+ return(NULL);
}
-
- return(ret);
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ cur = CUR;
+ while ((IS_PUBIDCHAR(cur)) && (cur != stop)) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ }
+ buf[len++] = cur;
+ NEXT;
+ cur = CUR;
+ if (cur == 0) {
+ GROW;
+ SHRINK;
+ cur = CUR;
+ }
+ }
+ buf[len] = 0;
+ if (cur != stop) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData, "Unfinished PubidLiteral\n");
+ ctxt->errNo = XML_ERR_LITERAL_NOT_FINISHED;
+ ctxt->wellFormed = 0;
+ } else {
+ NEXT;
+ }
+ return(buf);
}
/**
@@ -2905,7 +3201,10 @@
* "S SystemLiteral" is not detected. From a purely parsing
* point of view that's a nice mess.
*/
- const xmlChar *ptr = CUR_PTR;
+ const xmlChar *ptr;
+ GROW;
+
+ ptr = CUR_PTR;
if (!IS_BLANK(*ptr)) return(NULL);
while (IS_BLANK(*ptr)) ptr++;
@@ -2936,9 +3235,12 @@
*/
void
xmlParseComment(xmlParserCtxtPtr ctxt) {
- const xmlChar *q, *start;
- const xmlChar *r;
- xmlChar *val;
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 100;
+ xmlChar q;
+ xmlChar r;
+ xmlChar cur;
/*
* Check that there is a comment right here.
@@ -2949,34 +3251,57 @@
ctxt->instate = XML_PARSER_COMMENT;
SHRINK;
SKIP(4);
- start = q = CUR_PTR;
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return;
+ }
+ q = CUR;
NEXT;
- r = CUR_PTR;
+ r = CUR;
NEXT;
- while (IS_CHAR(CUR) &&
- ((CUR == ':') || (CUR != '>') ||
- (*r != '-') || (*q != '-'))) {
- if ((*r == '-') && (*q == '-')) {
+ cur = CUR;
+ while (IS_CHAR(cur) &&
+ ((cur != '>') ||
+ (r != '-') || (q != '-'))) {
+ if ((r == '-') && (q == '-')) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Comment must not contain '--' (double-hyphen)`\n");
ctxt->errNo = XML_ERR_HYPHEN_IN_COMMENT;
ctxt->wellFormed = 0;
}
- NEXT;r++;q++;
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return;
+ }
+ }
+ buf[len++] = q;
+ q = r;
+ r = cur;
+ NEXT;
+ cur = CUR;
+ if (cur == 0) {
+ SHRINK;
+ GROW;
+ cur = CUR;
+ }
}
- if (!IS_CHAR(CUR)) {
+ buf[len] = 0;
+ if (!IS_CHAR(cur)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
- "Comment not terminated \n<!--%.50s\n", start);
+ "Comment not terminated \n<!--%.50s\n", buf);
ctxt->errNo = XML_ERR_COMMENT_NOT_FINISHED;
ctxt->wellFormed = 0;
} else {
NEXT;
- val = xmlStrndup(start, q - start);
if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL))
- ctxt->sax->comment(ctxt->userData, val);
- xmlFree(val);
+ ctxt->sax->comment(ctxt->userData, buf);
+ xmlFree(buf);
}
}
@@ -3024,6 +3349,10 @@
void
xmlParsePI(xmlParserCtxtPtr ctxt) {
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 100;
+ xmlChar cur;
xmlChar *target;
if ((CUR == '<') && (NXT(1) == '?')) {
@@ -3039,9 +3368,13 @@
*/
target = xmlParsePITarget(ctxt);
if (target != NULL) {
- const xmlChar *q;
-
- if (!IS_BLANK(CUR)) {
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return;
+ }
+ cur = CUR;
+ if (!IS_BLANK(cur)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"xmlParsePI: PI %s space expected\n", target);
@@ -3049,20 +3382,34 @@
ctxt->wellFormed = 0;
}
SKIP_BLANKS;
- q = CUR_PTR;
- while (IS_CHAR(CUR) &&
- ((CUR != '?') || (NXT(1) != '>')))
+ cur = CUR;
+ while (IS_CHAR(cur) &&
+ ((cur != '?') || (NXT(1) != '>'))) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return;
+ }
+ }
+ buf[len++] = cur;
NEXT;
- if (!IS_CHAR(CUR)) {
+ cur = CUR;
+ if (cur == 0) {
+ SHRINK;
+ GROW;
+ cur = CUR;
+ }
+ }
+ buf[len] = 0;
+ if (!IS_CHAR(cur)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"xmlParsePI: PI %s never end ...\n", target);
ctxt->errNo = XML_ERR_PI_NOT_FINISHED;
ctxt->wellFormed = 0;
} else {
- xmlChar *data;
-
- data = xmlStrndup(q, CUR_PTR - q);
SKIP(2);
/*
@@ -3071,9 +3418,9 @@
if ((ctxt->sax) &&
(ctxt->sax->processingInstruction != NULL))
ctxt->sax->processingInstruction(ctxt->userData,
- target, data);
- xmlFree(data);
+ target, buf);
}
+ xmlFree(buf);
xmlFree(target);
} else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
@@ -4736,6 +5083,188 @@
}
return(ent);
}
+/**
+ * xmlParseStringEntityRef:
+ * @ctxt: an XML parser context
+ * @str: a pointer to an index in the string
+ *
+ * parse ENTITY references declarations, but this version parses it from
+ * a string value.
+ *
+ * [68] EntityRef ::= '&' Name ';'
+ *
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an internal DTD
+ * subset which contains no parameter entity references, or a document
+ * with "standalone='yes'", the Name given in the entity reference
+ * must match that in an entity declaration, except that well-formed
+ * documents need not declare any of the following entities: amp, lt,
+ * gt, apos, quot. The declaration of a parameter entity must precede
+ * any reference to it. Similarly, the declaration of a general entity
+ * must precede any reference to it which appears in a default value in an
+ * attribute-list declaration. Note that if entities are declared in the
+ * external subset or in external parameter entities, a non-validating
+ * processor is not obligated to read and process their declarations;
+ * for such documents, the rule that an entity must be declared is a
+ * well-formedness constraint only if standalone='yes'.
+ *
+ * [ WFC: Parsed Entity ]
+ * An entity reference must not contain the name of an unparsed entity
+ *
+ * Returns the xmlEntityPtr if found, or NULL otherwise. The str pointer
+ * is updated to the current location in the string.
+ */
+xmlEntityPtr
+xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
+ xmlChar *name;
+ const xmlChar *ptr;
+ xmlChar cur;
+ xmlEntityPtr ent = NULL;
+
+ GROW;
+
+ if ((str == NULL) || (*str == NULL)) return(NULL); /* !!! */
+ ptr = *str;
+ cur = *ptr;
+ if (cur == '&') {
+ ptr++;
+ cur = *ptr;
+ name = xmlParseStringName(ctxt, &ptr);
+ if (name == NULL) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseEntityRef: no name\n");
+ ctxt->errNo = XML_ERR_NAME_REQUIRED;
+ ctxt->wellFormed = 0;
+ } else {
+ if (CUR == ';') {
+ NEXT;
+ /*
+ * Ask first SAX for entity resolution, otherwise try the
+ * predefined set.
+ */
+ if (ctxt->sax != NULL) {
+ if (ctxt->sax->getEntity != NULL)
+ ent = ctxt->sax->getEntity(ctxt->userData, name);
+ if (ent == NULL)
+ ent = xmlGetPredefinedEntity(name);
+ }
+ /*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", the
+ * Name given in the entity reference must match that in an
+ * entity declaration, except that well-formed documents
+ * need not declare any of the following entities: amp, lt,
+ * gt, apos, quot.
+ * The declaration of a parameter entity must precede any
+ * reference to it.
+ * Similarly, the declaration of a general entity must
+ * precede any reference to it which appears in a default
+ * value in an attribute-list declaration. Note that if
+ * entities are declared in the external subset or in
+ * external parameter entities, a non-validating processor
+ * is not obligated to read and process their declarations;
+ * for such documents, the rule that an entity must be
+ * declared is a well-formedness constraint only if
+ * standalone='yes'.
+ */
+ if (ent == NULL) {
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) &&
+ (ctxt->hasPErefs == 0))) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Entity '%s' not defined\n", name);
+ ctxt->errNo = XML_ERR_UNDECLARED_ENTITY;
+ ctxt->wellFormed = 0;
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+ ctxt->sax->warning(ctxt->userData,
+ "Entity '%s' not defined\n", name);
+ ctxt->errNo = XML_WAR_UNDECLARED_ENTITY;
+ }
+ }
+
+ /*
+ * [ WFC: Parsed Entity ]
+ * An entity reference must not contain the name of an
+ * unparsed entity
+ */
+ else if (ent->type == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Entity reference to unparsed entity %s\n", name);
+ ctxt->errNo = XML_ERR_UNPARSED_ENTITY;
+ ctxt->wellFormed = 0;
+ }
+
+ /*
+ * [ WFC: No External Entity References ]
+ * Attribute values cannot contain direct or indirect
+ * entity references to external entities.
+ */
+ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
+ (ent->type == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Attribute references external entity '%s'\n", name);
+ ctxt->errNo = XML_ERR_ENTITY_IS_EXTERNAL;
+ ctxt->wellFormed = 0;
+ }
+ /*
+ * [ WFC: No < in Attribute Values ]
+ * The replacement text of any entity referred to directly or
+ * indirectly in an attribute value (other than "<") must
+ * not contain a <.
+ */
+ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
+ (ent != NULL) &&
+ (xmlStrcmp(ent->name, BAD_CAST "lt")) &&
+ (ent->content != NULL) &&
+ (xmlStrchr(ent->content, '<'))) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "'<' in entity '%s' is not allowed in attributes values\n", name);
+ ctxt->errNo = XML_ERR_LT_IN_ATTRIBUTE;
+ ctxt->wellFormed = 0;
+ }
+
+ /*
+ * Internal check, no parameter entities here ...
+ */
+ else {
+ switch (ent->type) {
+ case XML_INTERNAL_PARAMETER_ENTITY:
+ case XML_EXTERNAL_PARAMETER_ENTITY:
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "Attempt to reference the parameter entity '%s'\n", name);
+ ctxt->errNo = XML_ERR_ENTITY_IS_PARAMETER;
+ ctxt->wellFormed = 0;
+ break;
+ }
+ }
+
+ /*
+ * [ WFC: No Recursion ]
+ * TODO A parsed entity must not contain a recursive reference
+ * to itself, either directly or indirectly.
+ */
+
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseEntityRef: expecting ';'\n");
+ ctxt->errNo = XML_ERR_ENTITYREF_SEMICOL_MISSING;
+ ctxt->wellFormed = 0;
+ }
+ xmlFree(name);
+ }
+ }
+ return(ent);
+}
/**
* xmlParsePEReference:
@@ -4846,6 +5375,122 @@
}
/**
+ * xmlParseStringPEReference:
+ * @ctxt: an XML parser context
+ * @str: a pointer to an index in the string
+ *
+ * parse PEReference declarations
+ *
+ * [69] PEReference ::= '%' Name ';'
+ *
+ * [ WFC: No Recursion ]
+ * TODO A parsed entity must not contain a recursive
+ * reference to itself, either directly or indirectly.
+ *
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an internal DTD
+ * subset which contains no parameter entity references, or a document
+ * with "standalone='yes'", ... ... The declaration of a parameter
+ * entity must precede any reference to it...
+ *
+ * [ VC: Entity Declared ]
+ * In a document with an external subset or external parameter entities
+ * with "standalone='no'", ... ... The declaration of a parameter entity
+ * must precede any reference to it...
+ *
+ * [ WFC: In DTD ]
+ * Parameter-entity references may only appear in the DTD.
+ * NOTE: misleading but this is handled.
+ *
+ * Returns the string of the entity content.
+ * str is updated to the current value of the index
+ */
+xmlEntityPtr
+xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
+ const xmlChar *ptr;
+ xmlChar cur;
+ xmlChar *name;
+ xmlEntityPtr entity = NULL;
+
+ if ((str == NULL) || (*str == NULL)) return(NULL);
+ ptr = *str;
+ cur = *ptr;
+ if (cur == '%') {
+ ptr++;
+ cur = *ptr;
+ name = xmlParseStringName(ctxt, &ptr);
+ if (name == NULL) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseStringPEReference: no name\n");
+ ctxt->errNo = XML_ERR_NAME_REQUIRED;
+ ctxt->wellFormed = 0;
+ } else {
+ cur = *ptr;
+ if (cur == ';') {
+ ptr++;
+ cur = *ptr;
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->getParameterEntity != NULL))
+ entity = ctxt->sax->getParameterEntity(ctxt->userData,
+ name);
+ if (entity == NULL) {
+ /*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", ...
+ * ... The declaration of a parameter entity must precede
+ * any reference to it...
+ */
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) &&
+ (ctxt->hasPErefs == 0))) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "PEReference: %%%s; not found\n", name);
+ ctxt->errNo = XML_ERR_UNDECLARED_ENTITY;
+ ctxt->wellFormed = 0;
+ } else {
+ /*
+ * [ VC: Entity Declared ]
+ * In a document with an external subset or external
+ * parameter entities with "standalone='no'", ...
+ * ... The declaration of a parameter entity must
+ * precede any reference to it...
+ */
+ if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+ ctxt->sax->warning(ctxt->userData,
+ "PEReference: %%%s; not found\n", name);
+ ctxt->valid = 0;
+ }
+ } else {
+ /*
+ * Internal checking in case the entity quest barfed
+ */
+ if ((entity->type != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (entity->type != XML_EXTERNAL_PARAMETER_ENTITY)) {
+ if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
+ ctxt->sax->warning(ctxt->userData,
+ "Internal: %%%s; is not a parameter entity\n", name);
+ }
+ }
+ ctxt->hasPErefs = 1;
+ } else {
+ if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
+ ctxt->sax->error(ctxt->userData,
+ "xmlParseStringPEReference: expecting ';'\n");
+ ctxt->errNo = XML_ERR_ENTITYREF_SEMICOL_MISSING;
+ ctxt->wellFormed = 0;
+ }
+ xmlFree(name);
+ }
+ }
+ *str = ptr;
+ return(entity);
+}
+
+/**
* xmlParseDocTypeDecl :
* @ctxt: an XML parser context
*
@@ -5253,7 +5898,9 @@
*/
void
xmlParseCDSect(xmlParserCtxtPtr ctxt) {
- const xmlChar *base;
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 100;
xmlChar r, s;
xmlChar cur;
@@ -5267,11 +5914,10 @@
return;
ctxt->instate = XML_PARSER_CDATA_SECTION;
- base = CUR_PTR;
if (!IS_CHAR(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
- "CData section not finished\n%.50s\n", base);
+ "CData section not finished\n");
ctxt->wellFormed = 0;
ctxt->errNo = XML_ERR_CDATA_NOT_FINISHED;
ctxt->instate = XML_PARSER_CONTENT;
@@ -5282,7 +5928,7 @@
if (!IS_CHAR(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
- "CData section not finished\n%.50s\n", base);
+ "CData section not finished\n");
ctxt->errNo = XML_ERR_CDATA_NOT_FINISHED;
ctxt->wellFormed = 0;
ctxt->instate = XML_PARSER_CONTENT;
@@ -5291,31 +5937,48 @@
s = CUR;
NEXT;
cur = CUR;
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return;
+ }
while (IS_CHAR(cur) &&
((r != ']') || (s != ']') || (cur != '>'))) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return;
+ }
+ }
+ buf[len++] = r;
r = s;
s = cur;
NEXT;
cur = CUR;
}
+ buf[len] = 0;
ctxt->instate = XML_PARSER_CONTENT;
if (!IS_CHAR(CUR)) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
- "CData section not finished\n%.50s\n", base);
+ "CData section not finished\n%.50s\n", buf);
ctxt->errNo = XML_ERR_CDATA_NOT_FINISHED;
ctxt->wellFormed = 0;
+ xmlFree(buf);
return;
}
NEXT;
/*
- * Ok the segment [base CUR_PTR] is to be consumed as chars.
+ * Ok the buffer is to be consumed as cdata.
*/
if (ctxt->sax != NULL) {
if (ctxt->sax->cdataBlock != NULL)
- ctxt->sax->cdataBlock(ctxt->userData, base, (CUR_PTR - base) - 3);
+ ctxt->sax->cdataBlock(ctxt->userData, buf, len);
}
+ xmlFree(buf);
}
/**
@@ -5391,6 +6054,7 @@
*/
while ((CUR == 0) && (ctxt->inputNr > 1))
xmlPopInput(ctxt);
+ SHRINK;
if ((cons == ctxt->input->consumed) && (test == CUR_PTR) &&
(tok == ctxt->token)) {
@@ -5547,17 +6211,37 @@
*/
xmlChar *
xmlParseVersionNum(xmlParserCtxtPtr ctxt) {
- const xmlChar *q = CUR_PTR;
- xmlChar *ret;
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 10;
+ xmlChar cur;
- while (IS_CHAR(CUR) &&
- (((CUR >= 'a') && (CUR <= 'z')) ||
- ((CUR >= 'A') && (CUR <= 'Z')) ||
- ((CUR >= '0') && (CUR <= '9')) ||
- (CUR == '_') || (CUR == '.') ||
- (CUR == ':') || (CUR == '-'))) NEXT;
- ret = xmlStrndup(q, CUR_PTR - q);
- return(ret);
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ cur = CUR;
+ while (IS_CHAR(cur) &&
+ (((cur >= 'a') && (cur <= 'z')) ||
+ ((cur >= 'A') && (cur <= 'Z')) ||
+ ((cur >= '0') && (cur <= '9')) ||
+ (cur == '_') || (cur == '.') ||
+ (cur == ':') || (cur == '-'))) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ }
+ buf[len++] = cur;
+ NEXT;
+ cur=CUR;
+ }
+ buf[len] = 0;
+ return(buf);
}
/**
@@ -5641,25 +6325,54 @@
*/
xmlChar *
xmlParseEncName(xmlParserCtxtPtr ctxt) {
- const xmlChar *q = CUR_PTR;
- xmlChar *ret = NULL;
+ xmlChar *buf = NULL;
+ int len = 0;
+ int size = 10;
+ xmlChar cur;
- if (((CUR >= 'a') && (CUR <= 'z')) ||
- ((CUR >= 'A') && (CUR <= 'Z'))) {
+ cur = CUR;
+ if (((cur >= 'a') && (cur <= 'z')) ||
+ ((cur >= 'A') && (cur <= 'Z'))) {
+ buf = (xmlChar *) xmlMalloc(size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "malloc of %d byte failed\n", size);
+ return(NULL);
+ }
+
+ buf[len++] = cur;
NEXT;
- while (IS_CHAR(CUR) &&
- (((CUR >= 'a') && (CUR <= 'z')) ||
- ((CUR >= 'A') && (CUR <= 'Z')) ||
- ((CUR >= '0') && (CUR <= '9')) ||
- (CUR == '-'))) NEXT;
- ret = xmlStrndup(q, CUR_PTR - q);
+ cur = CUR;
+ while (IS_CHAR(cur) &&
+ (((cur >= 'a') && (cur <= 'z')) ||
+ ((cur >= 'A') && (cur <= 'Z')) ||
+ ((cur >= '0') && (cur <= '9')) ||
+ (cur == '.') || (cur == '_') ||
+ (cur == '-'))) {
+ if (len + 1 >= size) {
+ size *= 2;
+ buf = xmlRealloc(buf, size * sizeof(xmlChar));
+ if (buf == NULL) {
+ fprintf(stderr, "realloc of %d byte failed\n", size);
+ return(NULL);
+ }
+ }
+ buf[len++] = cur;
+ NEXT;
+ cur = CUR;
+ if (cur == 0) {
+ SHRINK;
+ GROW;
+ cur = CUR;
+ }
+ }
+ buf[len] = 0;
} else {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData, "Invalid XML encoding name\n");
ctxt->wellFormed = 0;
ctxt->errNo = XML_ERR_ENCODING_NAME;
}
- return(ret);
+ return(buf);
}
/**
diff --git a/result/HTML/reg4.html.err b/result/HTML/reg4.html.err
index d11f77c..2666b2c 100644
--- a/result/HTML/reg4.html.err
+++ b/result/HTML/reg4.html.err
@@ -1,3 +1,3 @@
-./test/HTML/reg4.html:10: error: Unexpected end tag : P
+./test/HTML/reg4.html:10: error: Unexpected end tag : p
</p>
^
diff --git a/result/HTML/test3.html.err b/result/HTML/test3.html.err
index 82d84a1..37414fc 100644
--- a/result/HTML/test3.html.err
+++ b/result/HTML/test3.html.err
@@ -1,12 +1,12 @@
-./test/HTML/test3.html:6: error: Unexpected end tag : P
+./test/HTML/test3.html:6: error: Unexpected end tag : p
</a><p><hr></p>
^
-./test/HTML/test3.html:13: error: Unexpected end tag : P
+./test/HTML/test3.html:13: error: Unexpected end tag : p
<p><hr></p>
^
-./test/HTML/test3.html:27: error: Opening and ending tag mismatch: H4 and B
+./test/HTML/test3.html:27: error: Opening and ending tag mismatch: h4 and b
<h4><b>Links</h4></b>
^
-./test/HTML/test3.html:27: error: Unexpected end tag : B
+./test/HTML/test3.html:27: error: Unexpected end tag : b
<h4><b>Links</h4></b>
^
diff --git a/tester.c b/tester.c
index 295a669..29ae6b3 100644
--- a/tester.c
+++ b/tester.c
@@ -38,6 +38,7 @@
#include "debugXML.h"
static int debug = 0;
+static int debugent = 0;
static int copy = 0;
static int recovery = 0;
static int noent = 0;
@@ -177,6 +178,8 @@
} else
xmlDebugDumpDocument(stdout, doc);
}
+ if (debugent)
+ xmlDebugDumpEntities(stdout, doc);
/*
* free it.
@@ -214,6 +217,8 @@
xmlDocDump(stdout, doc);
} else
xmlDebugDumpDocument(stdout, doc);
+ if (debugent)
+ xmlDebugDumpEntities(stdout, doc);
/*
* free it.
@@ -228,6 +233,8 @@
for (i = 1; i < argc ; i++) {
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
debug++;
+ if ((!strcmp(argv[i], "-debugent")) || (!strcmp(argv[i], "--debugent")))
+ debugent++;
else if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
copy++;
else if ((!strcmp(argv[i], "-recover")) ||
@@ -267,10 +274,11 @@
}
}
if (files == 0) {
- printf("Usage : %s [--debug] [--copy] [--recover] [--noent] [--noout] [--valid] [--repeat] XMLfiles ...\n",
+ printf("Usage : %s [--debug] [--debugent] [--copy] [--recover] [--noent] [--noout] [--valid] [--repeat] XMLfiles ...\n",
argv[0]);
printf("\tParse the XML files and output the result of the parsing\n");
printf("\t--debug : dump a debug tree of the in-memory document\n");
+ printf("\t--debugent : debug the entities defined in the document\n");
printf("\t--copy : used to test the internal copy implementation\n");
printf("\t--recover : output what is parsable on broken XmL documents\n");
printf("\t--noent : substitute entity references by their value\n");
diff --git a/tree.c b/tree.c
index f9cb877..5451f53 100644
--- a/tree.c
+++ b/tree.c
@@ -37,6 +37,7 @@
xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
static int xmlCompressMode = 0;
+static int xmlCheckDTD = 1;
#define UPDATE_LAST_CHILD(n) if ((n) != NULL) { \
xmlNodePtr ulccur = (n)->childs; \
@@ -1632,12 +1633,12 @@
xmlNodePtr prev;
if (parent == NULL) {
- fprintf(stderr, "xmladdChild : parent == NULL\n");
+ fprintf(stderr, "xmlAddChild : parent == NULL\n");
return(NULL);
}
if (cur == NULL) {
- fprintf(stderr, "xmladdChild : child == NULL\n");
+ fprintf(stderr, "xmlAddChild : child == NULL\n");
return(NULL);
}
@@ -2192,6 +2193,59 @@
}
/**
+ * xmlNodeGetBase:
+ * @doc: the document the node pertains to
+ * @cur: the node being checked
+ *
+ * Searches for the BASE URL. The code should work on both XML
+ * and HTML document even if base mechanisms are completely different.
+ *
+ * Returns a pointer to the base URL, or NULL if not found
+ * It's up to the caller to free the memory.
+ */
+xmlChar *
+xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) {
+ xmlChar *base;
+
+ if ((cur == NULL) && (doc == NULL))
+ return(NULL);
+ if (doc == NULL) doc = cur->doc;
+ if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
+ cur = doc->root;
+ while ((cur != NULL) && (cur->name != NULL)) {
+ if (cur->type != XML_ELEMENT_NODE) {
+ cur = cur->next;
+ continue;
+ }
+ if ((!xmlStrcmp(cur->name, BAD_CAST "html")) ||
+ (!xmlStrcmp(cur->name, BAD_CAST "HTML"))) {
+ cur = cur->childs;
+ continue;
+ }
+ if ((!xmlStrcmp(cur->name, BAD_CAST "head")) ||
+ (!xmlStrcmp(cur->name, BAD_CAST "HEAD"))) {
+ cur = cur->childs;
+ continue;
+ }
+ if ((!xmlStrcmp(cur->name, BAD_CAST "base")) ||
+ (!xmlStrcmp(cur->name, BAD_CAST "BASE"))) {
+ base = xmlGetProp(cur, BAD_CAST "href");
+ if (base != NULL) return(base);
+ return(xmlGetProp(cur, BAD_CAST "HREF"));
+ }
+ }
+ return(NULL);
+ }
+ while (cur != NULL) {
+ base = xmlGetProp(cur, BAD_CAST "xml:base");
+ if (base != NULL)
+ return(base);
+ cur = cur->parent;
+ }
+ return(NULL);
+}
+
+/**
* xmlNodeGetContent:
* @cur: the node being read
*
@@ -2565,6 +2619,7 @@
xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
xmlNsPtr cur;
+ if ((node == NULL) || (nameSpace == NULL)) return(NULL);
while (node != NULL) {
cur = node->nsDef;
while (cur != NULL) {
@@ -2577,6 +2632,8 @@
}
node = node->parent;
}
+#if 0
+ /* Removed support for old namespaces */
if (doc != NULL) {
cur = doc->oldNs;
while (cur != NULL) {
@@ -2586,6 +2643,7 @@
cur = cur->next;
}
}
+#endif
return(NULL);
}
@@ -2603,6 +2661,7 @@
xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar *href) {
xmlNsPtr cur;
+ if ((node == NULL) || (href == NULL)) return(NULL);
while (node != NULL) {
cur = node->nsDef;
while (cur != NULL) {
@@ -2613,6 +2672,8 @@
}
node = node->parent;
}
+#if 0
+ /* Removed support for old namespaces */
if (doc != NULL) {
cur = doc->oldNs;
while (cur != NULL) {
@@ -2622,6 +2683,7 @@
cur = cur->next;
}
}
+#endif
return(NULL);
}
@@ -2632,13 +2694,22 @@
*
* Search and get the value of an attribute associated to a node
* This does the entity substitution.
+ * This function looks in DTD attribute declaration for #FIXED or
+ * default declaration values unless DTD use has been turned off.
+ *
* Returns the attribute value or NULL if not found.
* It's up to the caller to free the memory.
*/
xmlChar *
xmlGetProp(xmlNodePtr node, const xmlChar *name) {
- xmlAttrPtr prop = node->properties;
+ xmlAttrPtr prop;
+ xmlDocPtr doc;
+ if ((node == NULL) || (name == NULL)) return(NULL);
+ /*
+ * Check on the properties attached to the node
+ */
+ prop = node->properties;
while (prop != NULL) {
if (!xmlStrcmp(prop->name, name)) {
xmlChar *ret;
@@ -2649,6 +2720,83 @@
}
prop = prop->next;
}
+ if (!xmlCheckDTD) return(NULL);
+
+ /*
+ * Check if there is a default declaration in the internal
+ * or external subsets
+ */
+ doc = node->doc;
+ if (doc != NULL) {
+ xmlAttributePtr attrDecl;
+ if (doc->intSubset != NULL) {
+ attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
+ if ((attrDecl == NULL) && (doc->extSubset != NULL))
+ attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
+ return(xmlStrdup(attrDecl->defaultValue));
+ }
+ }
+ return(NULL);
+}
+
+/**
+ * xmlGetNsProp:
+ * @node: the node
+ * @name: the attribute name
+ * @namespace: the URI of the namespace
+ *
+ * Search and get the value of an attribute associated to a node
+ * This attribute has to be anchored in the namespace specified.
+ * This does the entity substitution.
+ * This function looks in DTD attribute declaration for #FIXED or
+ * default declaration values unless DTD use has been turned off.
+ *
+ * Returns the attribute value or NULL if not found.
+ * It's up to the caller to free the memory.
+ */
+xmlChar *
+xmlGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *namespace) {
+ xmlAttrPtr prop = node->properties;
+ xmlDocPtr doc;
+ xmlNsPtr ns;
+
+ if (namespace == NULL)
+ return(xmlGetProp(node, name));
+ while (prop != NULL) {
+ if ((!xmlStrcmp(prop->name, name)) &&
+ (prop->ns != NULL) && (!xmlStrcmp(prop->ns->href, namespace))) {
+ xmlChar *ret;
+
+ ret = xmlNodeListGetString(node->doc, prop->val, 1);
+ if (ret == NULL) return(xmlStrdup((xmlChar *)""));
+ return(ret);
+ }
+ prop = prop->next;
+ }
+ if (!xmlCheckDTD) return(NULL);
+
+ /*
+ * Check if there is a default declaration in the internal
+ * or external subsets
+ */
+ doc = node->doc;
+ if (doc != NULL) {
+ xmlAttributePtr attrDecl;
+ if (doc->intSubset != NULL) {
+ attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
+ if ((attrDecl == NULL) && (doc->extSubset != NULL))
+ attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
+
+ if (attrDecl->prefix != NULL) {
+ /*
+ * The DTD declaration only allows a prefix search
+ */
+ ns = xmlSearchNs(doc, node, attrDecl->prefix);
+ if ((ns != NULL) && (!xmlStrcmp(ns->href, namespace)))
+ return(xmlStrdup(attrDecl->defaultValue));
+ }
+ }
+ }
return(NULL);
}
@@ -2748,6 +2896,7 @@
}
ret->use = 0;
ret->size = BASE_BUFFER_SIZE;
+ ret->alloc = xmlBufferAllocScheme;
ret->content = (xmlChar *) xmlMalloc(ret->size * sizeof(xmlChar));
if (ret->content == NULL) {
fprintf(stderr, "xmlBufferCreate : out of memory!\n");
@@ -2775,8 +2924,9 @@
return(NULL);
}
ret->use = 0;
+ ret->alloc = xmlBufferAllocScheme;
ret->size = (size ? size+2 : 0); /* +1 for ending null */
- if(ret->size){
+ if (ret->size){
ret->content = (xmlChar *) xmlMalloc(ret->size * sizeof(xmlChar));
if (ret->content == NULL) {
fprintf(stderr, "xmlBufferCreate : out of memory!\n");
@@ -2973,7 +3123,8 @@
* @str: the xmlChar string
* @len: the number of xmlChar to add
*
- * Add a string range to an XML buffer.
+ * Add a string range to an XML buffer. if len == -1, the lenght of
+ * str is recomputed.
*/
void
xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
@@ -2983,6 +3134,11 @@
fprintf(stderr, "xmlBufferAdd: str == NULL\n");
return;
}
+ if (len < -1) {
+ fprintf(stderr, "xmlBufferAdd: len < 0\n");
+ return;
+ }
+ if (len == 0) return;
/* CJN What's this for??? */
l = xmlStrlen(str);
@@ -3655,7 +3811,10 @@
if (zoutput == NULL) {
#endif
output = fopen(filename, "w");
- if (output == NULL) return(-1);
+ if (output == NULL) {
+ xmlBufferFree(buf);
+ return(-1);
+ }
#ifdef HAVE_ZLIB_H
}
diff --git a/tree.h b/tree.h
index 20a64df..e046073 100644
--- a/tree.h
+++ b/tree.h
@@ -112,6 +112,7 @@
xmlAttributeDefault def; /* the default */
const xmlChar *defaultValue;/* or the default value */
xmlEnumerationPtr tree; /* or the enumeration tree if any */
+ const xmlChar *prefix; /* the namespace prefix if any */
} xmlAttribute;
typedef xmlAttribute *xmlAttributePtr;
@@ -462,6 +463,9 @@
const xmlChar *value);
xmlChar * xmlGetProp (xmlNodePtr node,
const xmlChar *name);
+xmlChar * xmlGetNsProp (xmlNodePtr node,
+ const xmlChar *name,
+ const xmlChar *namespace);
xmlNodePtr xmlStringGetNodeList (xmlDocPtr doc,
const xmlChar *value);
xmlNodePtr xmlStringLenGetNodeList (xmlDocPtr doc,
@@ -484,6 +488,8 @@
xmlChar * xmlNodeGetLang (xmlNodePtr cur);
void xmlNodeSetLang (xmlNodePtr cur,
const xmlChar *lang);
+xmlChar * xmlNodeGetBase (xmlDocPtr doc,
+ xmlNodePtr cur);
/*
* Removing content.
diff --git a/valid.c b/valid.c
index 7de29d0..bc6d2ab 100644
--- a/valid.c
+++ b/valid.c
@@ -760,6 +760,8 @@
xmlAttributePtr ret, cur;
xmlAttributeTablePtr table;
xmlElementPtr elemDef;
+ xmlChar *rname;
+ xmlChar *ns;
int i;
if (dtd == NULL) {
@@ -821,12 +823,20 @@
}
/*
+ * Split the full name into a namespace prefix and the tag name
+ */
+ rname = xmlSplitQName(name, &ns);
+
+ /*
* Validity Check:
* Search the DTD for previous declarations of the ATTLIST
*/
for (i = 0;i < table->nb_attributes;i++) {
cur = table->table[i];
- if ((!xmlStrcmp(cur->name, name)) && (!xmlStrcmp(cur->elem, elem))) {
+ if ((ns != NULL) && (cur->prefix == NULL)) continue;
+ if ((ns == NULL) && (cur->prefix != NULL)) continue;
+ if ((!xmlStrcmp(cur->name, rname)) && (!xmlStrcmp(cur->elem, elem)) &&
+ ((ns == NULL) || (!xmlStrcmp(cur->prefix, ns)))) {
/*
* The attribute is already defined in this Dtd.
*/
@@ -862,7 +872,8 @@
* fill the structure.
*/
ret->type = type;
- ret->name = xmlStrdup(name);
+ ret->name = rname;
+ ret->prefix = ns;
ret->elem = xmlStrdup(elem);
ret->def = def;
ret->tree = tree;
@@ -902,6 +913,8 @@
xmlFree((xmlChar *) attr->name);
if (attr->defaultValue != NULL)
xmlFree((xmlChar *) attr->defaultValue);
+ if (attr->prefix != NULL)
+ xmlFree((xmlChar *) attr->prefix);
memset(attr, -1, sizeof(xmlAttribute));
xmlFree(attr);
}
diff --git a/xlink.c b/xlink.c
new file mode 100644
index 0000000..805156a
--- /dev/null
+++ b/xlink.c
@@ -0,0 +1,187 @@
+/*
+ * xlink.c : implementation of the hyperlinks detection module
+ * This version supports both XML XLinks and HTML simple links
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@w3.org
+ */
+
+
+#ifdef WIN32
+#define HAVE_FCNTL_H
+#include <io.h>
+#else
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h> /* for memset() only */
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_ZLIB_H
+#include <zlib.h>
+#endif
+
+#include "xmlmemory.h"
+#include "tree.h"
+#include "parser.h"
+#include "valid.h"
+#include "xlink.h"
+
+#define XLINK_NAMESPACE (BAD_CAST "http://www.w3.org/1999/xlink/namespace/")
+#define XHTML_NAMESPACE (BAD_CAST "http://www.w3.org/1999/xhtml/")
+
+/****************************************************************
+ * *
+ * Default setting and related functions *
+ * *
+ ****************************************************************/
+
+xlinkHandlerPtr xlinkDefaultHandler = NULL;
+xlinkNodeDetectFunc xlinkDefaultDetect = NULL;
+
+/**
+ * xlinkGetDefaultHandler:
+ *
+ * Get the default xlink handler.
+ *
+ * Returns the current xlinkHandlerPtr value.
+ */
+xlinkHandlerPtr
+xlinkGetDefaultHandler(void) {
+ return(xlinkDefaultHandler);
+}
+
+
+/**
+ * xlinkGetDefaultHandler:
+ * @handler: the new value for the xlink handler block
+ *
+ * Set the default xlink handlers
+ */
+void
+xlinkSetDefaultHandler(xlinkHandlerPtr handler) {
+ xlinkDefaultHandler = handler;
+}
+
+/**
+ * xlinkGetDefaultDetect:
+ *
+ * Get the default xlink detection routine
+ *
+ * Returns the current function or NULL;
+ */
+xlinkNodeDetectFunc
+xlinkGetDefaultDetect (void) {
+ return(xlinkDefaultDetect);
+}
+
+/**
+ * xlinkSetDefaultDetect:
+ * @func: pointer to the new detction routine.
+ *
+ * Set the default xlink detection routine
+ */
+void
+xlinkSetDefaultDetect (xlinkNodeDetectFunc func) {
+ xlinkDefaultDetect = func;
+}
+
+/****************************************************************
+ * *
+ * The detection routines *
+ * *
+ ****************************************************************/
+
+
+/**
+ * xlinkIsLink:
+ * @doc: the document containing the node
+ * @node: the node pointer itself
+ *
+ * Check whether the given node carries the attributes needed
+ * to be a link element (or is one of the linking elements issued
+ * from the (X)HTML DtDs).
+ * This routine don't try to do full checking of the link validity
+ * but tries to detect and return the appropriate link type.
+ *
+ * Returns the xlinkType of the node (XLINK_TYPE_NONE if there is no
+ * link detected.
+ */
+xlinkType
+xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) {
+ xmlChar *type = NULL, *role = NULL;
+ xlinkType ret = XLINK_TYPE_NONE;
+
+ if (node == NULL) return(XLINK_TYPE_NONE);
+ if (doc == NULL) doc = node->doc;
+ if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
+ /*
+ * This is an HTML document.
+ */
+ } else if ((node->ns != NULL) &&
+ (!xmlStrcmp(node->ns->href, XHTML_NAMESPACE))) {
+ /*
+ * !!!! We really need an IS_XHTML_ELEMENT function from HTMLtree.h @@@
+ */
+ /*
+ * This is an XHTML element within an XML document
+ * Check whether it's one of the element able to carry links
+ * and in that case if it holds the attributes.
+ */
+ }
+
+ /*
+ * We don't prevent a-priori having XML Linking constructs on
+ * XHTML elements
+ */
+ type = xmlGetNsProp(node, BAD_CAST"type", XLINK_NAMESPACE);
+ if (type != NULL) {
+ if (xmlStrcmp(type, BAD_CAST "simple")) {
+ ret = XLINK_TYPE_SIMPLE;
+ } if (xmlStrcmp(type, BAD_CAST "extended")) {
+ role = xmlGetNsProp(node, BAD_CAST "role", XLINK_NAMESPACE);
+ if (role != NULL) {
+ xmlNsPtr xlink;
+ xlink = xmlSearchNs(doc, node, XLINK_NAMESPACE);
+ if (xlink == NULL) {
+ /* Humm, fallback method */
+ if (!xmlStrcmp(role, BAD_CAST"xlink:external-linkset"))
+ ret = XLINK_TYPE_EXTENDED_SET;
+ } else {
+ xmlChar buf[200];
+#ifdef HAVE_SNPRINTF
+ snprintf((char *) buf, 199, "%s:external-linkset",
+ (char *) xlink->prefix);
+#else
+ sprintf((char *) buf, "%s:external-linkset",
+ (char *) xlink->prefix);
+#endif
+ if (!xmlStrcmp(role, buf))
+ ret = XLINK_TYPE_EXTENDED_SET;
+
+ }
+
+ }
+ ret = XLINK_TYPE_EXTENDED;
+ }
+ }
+
+ if (type != NULL) xmlFree(type);
+ if (role != NULL) xmlFree(role);
+ return(ret);
+}
diff --git a/xlink.h b/xlink.h
new file mode 100644
index 0000000..7d1025f
--- /dev/null
+++ b/xlink.h
@@ -0,0 +1,175 @@
+/*
+ * xlink.h : interfaces to the hyperlinks detection module
+ *
+ * See Copyright for the status of this software.
+ *
+ * Related specification: http://www.w3.org/TR/xlink
+ * http://www.w3.org/HTML/
+ * and XBase
+ *
+ * Daniel.Veillard@w3.org
+ */
+
+#ifndef __XML_XLINK_H__
+#define __XML_XLINK_H__
+
+#include "tree.h"
+
+/**
+ * Various defines for the various Link properties.
+ *
+ * NOTE: the link detection layer will try to resolve QName expansion
+ * of namespaces, if "foo" is the prefix for "http://foo.com/"
+ * then the link detection layer will expand role="foo:myrole"
+ * to "http://foo.com/:myrole"
+ * NOTE: the link detection layer will expand URI-Refences found on
+ * href attributes by using the base mechanism if found.
+ */
+typedef xmlChar *xlinkHRef;
+typedef xmlChar *xlinkRole;
+typedef xmlChar *xlinkTitle;
+
+typedef enum {
+ XLINK_TYPE_NONE = 0,
+ XLINK_TYPE_SIMPLE,
+ XLINK_TYPE_EXTENDED,
+ XLINK_TYPE_EXTENDED_SET
+} xlinkType;
+
+typedef enum {
+ XLINK_SHOW_NONE = 0,
+ XLINK_SHOW_NEW,
+ XLINK_SHOW_EMBED,
+ XLINK_SHOW_REPLACE
+} xlinkShow;
+
+typedef enum {
+ XLINK_ACTUATE_NONE = 0,
+ XLINK_ACTUATE_AUTO,
+ XLINK_ACTUATE_ONREQUEST
+} xlinkActuate;
+
+/**
+ * xlinkNodeDetectFunc:
+ * @ctx: user data pointer
+ * @node: the node to check
+ *
+ * This is the prototype for the link detection routine
+ * It calls the default link detection callbacks upon link detection.
+ */
+typedef void
+(*xlinkNodeDetectFunc) (void *ctx,
+ xmlNodePtr node);
+
+/**
+ * The link detection module interract with the upper layers using
+ * a set of callback registered at parsing time.
+ */
+
+/**
+ * xlinkSimpleLinkFunk:
+ * @ctx: user data pointer
+ * @node: the node carrying the link
+ * @href: the target of the link
+ * @role: the role string
+ * @title: the link title
+ *
+ * This is the prototype for a simple link detection callback.
+ */
+typedef void
+(*xlinkSimpleLinkFunk) (void *ctx,
+ xmlNodePtr node,
+ const xlinkHRef href,
+ const xlinkRole role,
+ const xlinkTitle title);
+
+/**
+ * xlinkExtendedLinkFunk:
+ * @ctx: user data pointer
+ * @node: the node carrying the link
+ * @nbLocators: the number of locators detected on the link
+ * @hrefs: pointer to the array of locator hrefs
+ * @roles: pointer to the array of locator roles
+ * @nbArcs: the number of arcs detected on the link
+ * @from: pointer to the array of source roles found on the arcs
+ * @to: pointer to the array of target roles found on the arcs
+ * @show: array of values for the show attributes found on the arcs
+ * @actuate: array of values for the actuate attributes found on the arcs
+ * @nbTitles: the number of titles detected on the link
+ * @title: array of titles detected on the link
+ * @langs: array of xml:lang values for the titles
+ *
+ * This is the prototype for a extended link detection callback.
+ */
+typedef void
+(*xlinkExtendedLinkFunk)(void *ctx,
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbArcs,
+ const xlinkRole *from,
+ const xlinkRole *to,
+ xlinkShow *show,
+ xlinkActuate *actuate,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
+
+/**
+ * xlinkExtendedLinkSetFunk:
+ * @ctx: user data pointer
+ * @node: the node carrying the link
+ * @nbLocators: the number of locators detected on the link
+ * @hrefs: pointer to the array of locator hrefs
+ * @roles: pointer to the array of locator roles
+ * @nbTitles: the number of titles detected on the link
+ * @title: array of titles detected on the link
+ * @langs: array of xml:lang values for the titles
+ *
+ * This is the prototype for a extended link set detection callback.
+ */
+typedef void
+(*xlinkExtendedLinkSetFunk) (void *ctx,
+ xmlNodePtr node,
+ int nbLocators,
+ const xlinkHRef *hrefs,
+ const xlinkRole *roles,
+ int nbTitles,
+ const xlinkTitle *titles,
+ const xmlChar **langs);
+
+/**
+ * This is the structure containing a set of Links detection callbacks
+ *
+ * There is no default xlink callbacks, if one want to get link
+ * recognition activated, those call backs must be provided before parsing.
+ */
+typedef struct xlinkHandler {
+ xlinkSimpleLinkFunk simple;
+ xlinkExtendedLinkFunk extended;
+ xlinkExtendedLinkSetFunk set;
+} xlinkHandler;
+typedef xlinkHandler *xlinkHandlerPtr;
+
+/**
+ * the default detection routine, can be overriden, they call the default
+ * detection callbacks.
+ */
+
+xlinkNodeDetectFunc xlinkGetDefaultDetect (void);
+void xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
+
+/**
+ * Routines to set/get the default handlers.
+ */
+xlinkHandlerPtr xlinkGetDefaultHandler (void);
+void xlinkSetDefaultHandler (xlinkHandlerPtr handler);
+
+/*
+ * Link detection module itself.
+ */
+xlinkType xlinkIsLink (xmlDocPtr doc,
+ xmlNodePtr node);
+
+#endif /* __XML_XLINK_H__ */
diff --git a/xmlmemory.c b/xmlmemory.c
index d88fbb1..1915052 100644
--- a/xmlmemory.c
+++ b/xmlmemory.c
@@ -140,8 +140,9 @@
p = (MEMHDR *) malloc(RESERVE_SIZE+size);
if (!p) {
- fprintf(stderr, "xmlMalloc : Out of free space\n");
- xmlMemoryDump();
+ fprintf(stderr, "xmlMalloc : Out of free space\n");
+ xmlMemoryDump();
+ return(NULL);
}
p->mh_tag = MEMTAG;
p->mh_number = ++block;
diff --git a/xpath.c b/xpath.c
index f646e9f..9181e33 100644
--- a/xpath.c
+++ b/xpath.c
@@ -1774,6 +1774,7 @@
* @cur: the current attribute in the traversal
*
* Traversal function for the "attribute" direction
+ * TODO: support DTD inherited default attributes
*
* Returns the next element following that axis
*/