diff --git a/ChangeLog b/ChangeLog index f352092f..44038b06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Tue Oct 31 14:14:13 CET 2000 Daniel Veillard + + * HTMLparser.c: fixed loop on invalid char in scripts + * parser.c: update to description of xmlIOParseDTD() + * libxml.m4 xmlversion.h.in: changes contributed by + Michael Schmeing + * configure.in: preparing for 2.2.7 + * Makefile.am: trying to avoid config.h and acconfig.h + being included in the distrib + * configure.in: released 2.2.7 + +Mon Oct 30 17:08:10 CET 2000 Daniel Veillard + + * tree.[ch] debugXML.c parserInternals.c xpath.c: Deprecated Pi's + like namespaces for good. Unified xmlNs and xmlNode somewhat. + Mon Oct 30 16:26:49 CET 2000 Daniel Veillard * parser.[ch]: added xmlIOParseDTD() diff --git a/HTMLparser.c b/HTMLparser.c index b5e46fcf..0e2d4cc8 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -2329,6 +2329,14 @@ htmlParseScript(htmlParserCtxtPtr ctxt) { NEXT; cur = CUR; } + if (!(IS_CHAR(cur))) { + if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) + ctxt->sax->error(ctxt->userData, + "Invalid char in CDATA 0x%X\n", cur); + ctxt->wellFormed = 0; + NEXT; + } + if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) { if (ctxt->sax->cdataBlock!= NULL) { /* diff --git a/Makefile.am b/Makefile.am index 713ecd27..e8cd50e5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -363,7 +363,7 @@ confexecdir=$(libdir) confexec_DATA = xmlConf.sh EXTRA_DIST = xmlConf.sh.in libxml.spec.in libxml.spec libxml.m4 \ example/Makefile.am example/gjobread.c example/gjobs.xml \ - $(man_MANS) libxml-2.0.pc.in include/libxml/*.h xmlversion.h.in \ + $(man_MANS) libxml-2.0.pc.in xmlversion.h.in \ win32/README.MSDev win32/Makefile.mingw win32/libxml2/libxml2.dsp pkgconfigdir = $(libdir)/pkgconfig diff --git a/configure.in b/configure.in index 0b7c3216..df3b7e30 100644 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ AC_CANONICAL_HOST LIBXML_MAJOR_VERSION=2 LIBXML_MINOR_VERSION=2 -LIBXML_MICRO_VERSION=6 +LIBXML_MICRO_VERSION=7 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 6873d71e..4a1ce5b4 100644 --- a/debugXML.c +++ b/debugXML.c @@ -377,8 +377,10 @@ void xmlDebugDumpNamespace(FILE *output, xmlNsPtr ns, int depth) { shift[2 * i] = shift[2 * i + 1] = 0; fprintf(output, shift); - if (ns->type == XML_GLOBAL_NAMESPACE) - fprintf(output, "old "); + if (ns->type != XML_NAMESPACE_DECL) { + fprintf(output, "invalid namespace node %d\n", ns->type); + return; + } if (ns->href == NULL) { if (ns->prefix != NULL) fprintf(output, "incomplete namespace %s href=NULL\n", ns->prefix); @@ -571,6 +573,9 @@ void xmlDebugDumpOneNode(FILE *output, xmlNodePtr node, int depth) { case XML_ENTITY_DECL: xmlDebugDumpEntityDecl(output, (xmlEntityPtr) node, depth); return; + case XML_NAMESPACE_DECL: + xmlDebugDumpNamespace(output, (xmlNsPtr) node, depth); + return; default: fprintf(output, shift); fprintf(output, "NODE_%d !!!\n", node->type); @@ -911,6 +916,7 @@ static int xmlLsCountNode(xmlNodePtr node) { case XML_ELEMENT_DECL: case XML_ATTRIBUTE_DECL: case XML_ENTITY_DECL: + case XML_NAMESPACE_DECL: ret = 1; break; } diff --git a/doc/html/gnome-xml-debugxml.html b/doc/html/gnome-xml-debugxml.html index 45727800..18999f16 100644 --- a/doc/html/gnome-xml-debugxml.html +++ b/doc/html/gnome-xml-debugxml.html @@ -115,7 +115,7 @@ SIZE="3" >

Name

Synopsis

Description

Details
















Name

Synopsis

Description

Details






















Name

Synopsis

Description

Details




















Name

Synopsis

Description

Details































Name

Synopsis

Description

Details














Name

Synopsis

Description

Details























Name

Synopsis

Description

Details










xmlChar *SystemID); +xmlDtdPtr xmlIOParseDTD (xmlSAXHandlerPtr sax, + xmlParserInputBufferPtr input, + xmlCharEncoding enc); int xmlParseBalancedChunkMemory

Description

Details



























































































xmlIOParseDTD ()

xmlDtdPtr   xmlIOParseDTD                   (xmlSAXHandlerPtr sax,
+                                             xmlParserInputBufferPtr input,
+                                             xmlCharEncoding enc);

Load and parse a DTD

sax : the SAX handler block or NULL
input : an Input Buffer
enc : the charset encoding if known
Returns :the resulting xmlDtdPtr or NULL in case of error. +input will be freed at parsing end.


























Name

Synopsis

Description

Details




















































































































Name

Synopsis

Description

Details





































Name

Synopsis

xmlElementPtr; -enum XML_LOCAL_NAMESPACE +typedef xmlNsType; @@ -1627,7 +1631,7 @@ HREF="gnome-xml-tree.html#XMLSETCOMPRESSMODE" >

Description

Details




















enum xmlNsType

XML_LOCAL_NAMESPACE

typedef enum {
-    XML_GLOBAL_NAMESPACE = 1,	/* old style global namespace */
-    XML_LOCAL_NAMESPACE		/* new style local scoping */
-} xmlNsType;
#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL

xmlNsType

typedef xmlElementType xmlNsType;






































































































































Name

Synopsis

Description

Details











Name

Synopsis

Description

Details






























































Name

Synopsis

Description

Details







Name

Synopsis

Description

Details






































Name

Synopsis

Description

Details




















Name

Synopsis

Description

Details

































Name

Synopsis

Description

Details







+ @@ -172,6 +173,7 @@ + @@ -497,12 +499,21 @@ + + + + + + + + + @@ -544,8 +555,8 @@ - - + + diff --git a/include/libxml/tree.h b/include/libxml/tree.h index bcca976b..8c4f7088 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -40,11 +40,10 @@ typedef enum { XML_DTD_NODE= 14, XML_ELEMENT_DECL= 15, XML_ATTRIBUTE_DECL= 16, -#ifdef LIBXML_SGML_ENABLED XML_ENTITY_DECL= 17, - XML_SGML_DOCUMENT_NODE= 18 -#else - XML_ENTITY_DECL= 17 + XML_NAMESPACE_DECL= 18 +#ifdef LIBXML_SGML_ENABLED + ,XML_SGML_DOCUMENT_NODE= 19 #endif } xmlElementType; @@ -192,12 +191,13 @@ struct _xmlElement { * An XML namespace. * Note that prefix == NULL is valid, it defines the default namespace * within the subtree (until overriden). + * + * XML_GLOBAL_NAMESPACE is now deprecated for good + * xmlNsType is unified with xmlElementType */ -typedef enum { - XML_GLOBAL_NAMESPACE = 1, /* old style global namespace */ - XML_LOCAL_NAMESPACE /* new style local scoping */ -} xmlNsType; +#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL +typedef xmlElementType xmlNsType; typedef struct _xmlNs xmlNs; typedef xmlNs *xmlNsPtr; diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in index 74484b46..01b1ea17 100644 --- a/include/libxml/xmlversion.h.in +++ b/include/libxml/xmlversion.h.in @@ -18,6 +18,7 @@ extern "C" { * your library and includes mismatch */ extern void xmlCheckVersion(int version); +#define LIBXML_DOTTED_VERSION "@VERSION@" #define LIBXML_VERSION @LIBXML_VERSION_NUMBER@ #define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" #define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); diff --git a/libxml.m4 b/libxml.m4 index 1a03d570..1401af53 100644 --- a/libxml.m4 +++ b/libxml.m4 @@ -42,25 +42,30 @@ dnl AC_TRY_RUN([ #include #include -#include +#include #include int main() { + int xml_major_version, xml_minor_version, xml_micro_version; int major, minor, micro; char *tmp_version; system("touch conf.xmltest"); - tmp_version = g_strdup("$min_xml_version"); + tmp_version = xmlStrdup("$min_xml_version"); if(sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_xml_version"); exit(1); } - return 0; /* FIXME */ -#if 0 /* FIXME */ + tmp_version = xmlStrdup(LIBXML_DOTTED_VERSION); + if(sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) { + printf("%s, bad version string\n", "$min_xml_version"); + exit(1); + } + if((xml_major_version != $xml_config_major_version) || (xml_minor_version != $xml_config_minor_version) || (xml_micro_version != $xml_config_micro_version)) @@ -103,7 +108,6 @@ main() printf("*** so that the correct libraries are found at run-time))\n"); } } -#endif return 1; } ],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) diff --git a/parser.c b/parser.c index 425ef57c..ea8170fa 100644 --- a/parser.c +++ b/parser.c @@ -8369,6 +8369,7 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, * Load and parse a DTD * * Returns the resulting xmlDtdPtr or NULL in case of error. + * @input will be freed at parsing end. */ xmlDtdPtr diff --git a/parserInternals.c b/parserInternals.c index b7b54bb9..6ab5c5bd 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -3403,3 +3403,107 @@ handle_as_char: #endif } +/** + * xmlNewGlobalNs: + * @doc: the document carrying the namespace + * @href: the URI associated + * @prefix: the prefix for the namespace + * + * Creation of a Namespace, the old way using PI and without scoping + * DEPRECATED !!! + * It now create a namespace on the root element of the document if found. + * Returns NULL this functionnality had been removed + */ +xmlNsPtr +xmlNewGlobalNs(xmlDocPtr doc, const xmlChar *href, const xmlChar *prefix) { + static int deprecated = 0; + if (!deprecated) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewGlobalNs() deprecated function reached\n"); + deprecated = 1; + } + return(NULL); +#if 0 + xmlNodePtr root; + + xmlNsPtr cur; + + root = xmlDocGetRootElement(doc); + if (root != NULL) + return(xmlNewNs(root, href, prefix)); + + /* + * if there is no root element yet, create an old Namespace type + * and it will be moved to the root at save time. + */ + cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); + if (cur == NULL) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewGlobalNs : malloc failed\n"); + return(NULL); + } + memset(cur, 0, sizeof(xmlNs)); + cur->type = XML_GLOBAL_NAMESPACE; + + if (href != NULL) + cur->href = xmlStrdup(href); + if (prefix != NULL) + cur->prefix = xmlStrdup(prefix); + + /* + * Add it at the end to preserve parsing order ... + */ + if (doc != NULL) { + if (doc->oldNs == NULL) { + doc->oldNs = cur; + } else { + xmlNsPtr prev = doc->oldNs; + + while (prev->next != NULL) prev = prev->next; + prev->next = cur; + } + } + + return(NULL); +#endif +} + +/** + * xmlUpgradeOldNs: + * @doc: a document pointer + * + * Upgrade old style Namespaces (PI) and move them to the root of the document. + * DEPRECATED + */ +void +xmlUpgradeOldNs(xmlDocPtr doc) { + static int deprecated = 0; + if (!deprecated) { + xmlGenericError(xmlGenericErrorContext, + "xmlNewGlobalNs() deprecated function reached\n"); + deprecated = 1; + } +#if 0 + xmlNsPtr cur; + + if ((doc == NULL) || (doc->oldNs == NULL)) return; + if (doc->children == NULL) { +#ifdef DEBUG_TREE + xmlGenericError(xmlGenericErrorContext, + "xmlUpgradeOldNs: failed no root !\n"); +#endif + return; + } + + cur = doc->oldNs; + while (cur->next != NULL) { + cur->type = XML_LOCAL_NAMESPACE; + cur = cur->next; + } + cur->type = XML_LOCAL_NAMESPACE; + cur->next = doc->children->nsDef; + doc->children->nsDef = doc->oldNs; + doc->oldNs = NULL; +#endif +} + diff --git a/tree.c b/tree.c index 0ef82a46..ff7d7685 100644 --- a/tree.c +++ b/tree.c @@ -92,36 +92,6 @@ xmlGetBufferAllocationScheme() { return xmlBufferAllocScheme; } -/** - * xmlUpgradeOldNs: - * @doc: a document pointer - * - * Upgrade old style Namespaces (PI) and move them to the root of the document. - */ -void -xmlUpgradeOldNs(xmlDocPtr doc) { - xmlNsPtr cur; - - if ((doc == NULL) || (doc->oldNs == NULL)) return; - if (doc->children == NULL) { -#ifdef DEBUG_TREE - xmlGenericError(xmlGenericErrorContext, - "xmlUpgradeOldNs: failed no root !\n"); -#endif - return; - } - - cur = doc->oldNs; - while (cur->next != NULL) { - cur->type = XML_LOCAL_NAMESPACE; - cur = cur->next; - } - cur->type = XML_LOCAL_NAMESPACE; - cur->next = doc->children->nsDef; - doc->children->nsDef = doc->oldNs; - doc->oldNs = NULL; -} - /** * xmlNewNs: * @node: the element carrying the namespace @@ -185,62 +155,6 @@ xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix) { return(cur); } -/** - * xmlNewGlobalNs: - * @doc: the document carrying the namespace - * @href: the URI associated - * @prefix: the prefix for the namespace - * - * Creation of a Namespace, the old way using PI and without scoping - * DEPRECATED !!! - * It now create a namespace on the root element of the document if found. - * Returns NULL this functionnality had been removed - */ -xmlNsPtr -xmlNewGlobalNs(xmlDocPtr doc, const xmlChar *href, const xmlChar *prefix) { - xmlNodePtr root; - - xmlNsPtr cur; - - root = xmlDocGetRootElement(doc); - if (root != NULL) - return(xmlNewNs(root, href, prefix)); - - /* - * if there is no root element yet, create an old Namespace type - * and it will be moved to the root at save time. - */ - cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); - if (cur == NULL) { - xmlGenericError(xmlGenericErrorContext, - "xmlNewGlobalNs : malloc failed\n"); - return(NULL); - } - memset(cur, 0, sizeof(xmlNs)); - cur->type = XML_GLOBAL_NAMESPACE; - - if (href != NULL) - cur->href = xmlStrdup(href); - if (prefix != NULL) - cur->prefix = xmlStrdup(prefix); - - /* - * Add it at the end to preserve parsing order ... - */ - if (doc != NULL) { - if (doc->oldNs == NULL) { - doc->oldNs = cur; - } else { - xmlNsPtr prev = doc->oldNs; - - while (prev->next != NULL) prev = prev->next; - prev->next = cur; - } - } - - return(NULL); -} - /** * xmlSetNs: * @node: a node in the document @@ -2390,16 +2304,13 @@ xmlCopyNamespace(xmlNsPtr cur) { if (cur == NULL) return(NULL); switch (cur->type) { - case XML_GLOBAL_NAMESPACE: - ret = xmlNewGlobalNs(NULL, cur->href, cur->prefix); - break; case XML_LOCAL_NAMESPACE: ret = xmlNewNs(NULL, cur->href, cur->prefix); break; default: #ifdef DEBUG_TREE xmlGenericError(xmlGenericErrorContext, - "xmlCopyNamespace: unknown type %d\n", cur->type); + "xmlCopyNamespace: invalid type %d\n", cur->type); #endif return(NULL); } @@ -2817,6 +2728,7 @@ xmlNodeSetLang(xmlNodePtr cur, const xmlChar *lang) { case XML_PI_NODE: case XML_ENTITY_REF_NODE: case XML_ENTITY_NODE: + case XML_NAMESPACE_DECL: #ifdef LIBXML_SGML_ENABLED case XML_SGML_DOCUMENT_NODE: #endif @@ -2879,6 +2791,7 @@ xmlNodeSetSpacePreserve(xmlNodePtr cur, int val) { case XML_PI_NODE: case XML_ENTITY_REF_NODE: case XML_ENTITY_NODE: + case XML_NAMESPACE_DECL: #ifdef LIBXML_SGML_ENABLED case XML_SGML_DOCUMENT_NODE: #endif @@ -2949,6 +2862,7 @@ xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) { case XML_DOCUMENT_FRAG_NODE: case XML_NOTATION_NODE: case XML_HTML_DOCUMENT_NODE: + case XML_NAMESPACE_DECL: #ifdef LIBXML_SGML_ENABLED case XML_SGML_DOCUMENT_NODE: #endif @@ -2996,6 +2910,7 @@ xmlNodeSetBase(xmlNodePtr cur, xmlChar* uri) { case XML_PI_NODE: case XML_ENTITY_REF_NODE: case XML_ENTITY_NODE: + case XML_NAMESPACE_DECL: #ifdef LIBXML_SGML_ENABLED case XML_SGML_DOCUMENT_NODE: #endif @@ -3115,6 +3030,9 @@ xmlNodeGetContent(xmlNodePtr cur) { case XML_SGML_DOCUMENT_NODE: #endif return(NULL); + case XML_NAMESPACE_DECL: + /* TODO !!! */ + return(NULL); case XML_ELEMENT_DECL: /* TODO !!! */ return(NULL); @@ -3208,6 +3126,8 @@ xmlNodeSetContent(xmlNodePtr cur, const xmlChar *content) { break; case XML_DTD_NODE: break; + case XML_NAMESPACE_DECL: + break; case XML_ELEMENT_DECL: /* TODO !!! */ break; @@ -3286,6 +3206,7 @@ xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) { case XML_DTD_NODE: case XML_HTML_DOCUMENT_NODE: case XML_DOCUMENT_TYPE_NODE: + case XML_NAMESPACE_DECL: #ifdef LIBXML_SGML_ENABLED case XML_SGML_DOCUMENT_NODE: #endif @@ -3374,6 +3295,7 @@ xmlNodeAddContentLen(xmlNodePtr cur, const xmlChar *content, int len) { case XML_DTD_NODE: case XML_HTML_DOCUMENT_NODE: case XML_DOCUMENT_TYPE_NODE: + case XML_NAMESPACE_DECL: #ifdef LIBXML_SGML_ENABLED case XML_SGML_DOCUMENT_NODE: #endif @@ -4617,51 +4539,6 @@ xmlNodeListDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, void htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur); -/** - * xmlGlobalNsDump: - * @buf: the XML buffer output - * @cur: a namespace - * - * Dump a global Namespace, this is the old version based on PIs. - */ -static void -xmlGlobalNsDump(xmlBufferPtr buf, xmlNsPtr cur) { - if (cur == NULL) { -#ifdef DEBUG_TREE - xmlGenericError(xmlGenericErrorContext, - "xmlGlobalNsDump : Ns == NULL\n"); -#endif - return; - } - if (cur->type == XML_GLOBAL_NAMESPACE) { - xmlBufferWriteChar(buf, "href != NULL) { - xmlBufferWriteChar(buf, " href="); - xmlBufferWriteQuotedString(buf, cur->href); - } - if (cur->prefix != NULL) { - xmlBufferWriteChar(buf, " AS="); - xmlBufferWriteQuotedString(buf, cur->prefix); - } - xmlBufferWriteChar(buf, "?>\n"); - } -} - -/** - * xmlGlobalNsListDump: - * @buf: the XML buffer output - * @cur: the first namespace - * - * Dump a list of global Namespace, this is the old version based on PIs. - */ -static void -xmlGlobalNsListDump(xmlBufferPtr buf, xmlNsPtr cur) { - while (cur != NULL) { - xmlGlobalNsDump(buf, cur); - cur = cur->next; - } -} - /** * xmlNsDump: * @buf: the XML buffer output @@ -5087,12 +4964,6 @@ xmlDocContentDump(xmlBufferPtr buf, xmlDocPtr cur) { if (cur->children != NULL) { xmlNodePtr child = cur->children; - /* global namespace definitions, the old way */ - if (oldXMLWDcompatibility) - xmlGlobalNsListDump(buf, cur->oldNs); - else - xmlUpgradeOldNs(cur); - while (child != NULL) { xmlNodeDump(buf, cur, child, 0, 1); xmlBufferWriteChar(buf, "\n"); @@ -5113,51 +4984,6 @@ xmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, static void xmlNodeListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, int format, const char *encoding); -/** - * xmlGlobalNsDumpOutput: - * @buf: the XML buffer output - * @cur: a namespace - * - * Dump a global Namespace, this is the old version based on PIs. - */ -static void -xmlGlobalNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur) { - if (cur == NULL) { -#ifdef DEBUG_TREE - xmlGenericError(xmlGenericErrorContext, - "xmlGlobalNsDump : Ns == NULL\n"); -#endif - return; - } - if (cur->type == XML_GLOBAL_NAMESPACE) { - xmlOutputBufferWriteString(buf, "href != NULL) { - xmlOutputBufferWriteString(buf, " href="); - xmlBufferWriteQuotedString(buf->buffer, cur->href); - } - if (cur->prefix != NULL) { - xmlOutputBufferWriteString(buf, " AS="); - xmlBufferWriteQuotedString(buf->buffer, cur->prefix); - } - xmlOutputBufferWriteString(buf, "?>\n"); - } -} - -/** - * xmlGlobalNsListDumpOutput: - * @buf: the XML buffer output - * @cur: the first namespace - * - * Dump a list of global Namespace, this is the old version based on PIs. - */ -static void -xmlGlobalNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur) { - while (cur != NULL) { - xmlGlobalNsDumpOutput(buf, cur); - cur = cur->next; - } -} - /** * xmlNsDumpOutput: * @buf: the XML buffer output @@ -5571,12 +5397,6 @@ xmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur, if (cur->children != NULL) { xmlNodePtr child = cur->children; - /* global namespace definitions, the old way */ - if (oldXMLWDcompatibility) - xmlGlobalNsListDumpOutput(buf, cur->oldNs); - else - xmlUpgradeOldNs(cur); - while (child != NULL) { xmlNodeDumpOutput(buf, cur, child, 0, 1, encoding); xmlOutputBufferWriteString(buf, "\n"); diff --git a/tree.h b/tree.h index bcca976b..8c4f7088 100644 --- a/tree.h +++ b/tree.h @@ -40,11 +40,10 @@ typedef enum { XML_DTD_NODE= 14, XML_ELEMENT_DECL= 15, XML_ATTRIBUTE_DECL= 16, -#ifdef LIBXML_SGML_ENABLED XML_ENTITY_DECL= 17, - XML_SGML_DOCUMENT_NODE= 18 -#else - XML_ENTITY_DECL= 17 + XML_NAMESPACE_DECL= 18 +#ifdef LIBXML_SGML_ENABLED + ,XML_SGML_DOCUMENT_NODE= 19 #endif } xmlElementType; @@ -192,12 +191,13 @@ struct _xmlElement { * An XML namespace. * Note that prefix == NULL is valid, it defines the default namespace * within the subtree (until overriden). + * + * XML_GLOBAL_NAMESPACE is now deprecated for good + * xmlNsType is unified with xmlElementType */ -typedef enum { - XML_GLOBAL_NAMESPACE = 1, /* old style global namespace */ - XML_LOCAL_NAMESPACE /* new style local scoping */ -} xmlNsType; +#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL +typedef xmlElementType xmlNsType; typedef struct _xmlNs xmlNs; typedef xmlNs *xmlNsPtr; diff --git a/xmlversion.h.in b/xmlversion.h.in index 74484b46..01b1ea17 100644 --- a/xmlversion.h.in +++ b/xmlversion.h.in @@ -18,6 +18,7 @@ extern "C" { * your library and includes mismatch */ extern void xmlCheckVersion(int version); +#define LIBXML_DOTTED_VERSION "@VERSION@" #define LIBXML_VERSION @LIBXML_VERSION_NUMBER@ #define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@" #define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@); diff --git a/xpath.c b/xpath.c index 0e79c94d..dbffba65 100644 --- a/xpath.c +++ b/xpath.c @@ -1975,6 +1975,7 @@ xmlXPathNextChild(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { case XML_ATTRIBUTE_DECL: case XML_ENTITY_DECL: case XML_ATTRIBUTE_NODE: + case XML_NAMESPACE_DECL: return(NULL); } return(NULL); @@ -2102,6 +2103,13 @@ xmlXPathNextParent(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { case XML_SGML_DOCUMENT_NODE: #endif return(NULL); + case XML_NAMESPACE_DECL: + /* + * TODO !!! may require extending struct _xmlNs with + * parent field + * C.f. Infoset case... + */ + return(NULL); } } return(NULL); @@ -2159,6 +2167,13 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { case XML_SGML_DOCUMENT_NODE: #endif return(NULL); + case XML_NAMESPACE_DECL: + /* + * TODO !!! may require extending struct _xmlNs with + * parent field + * C.f. Infoset case... + */ + return(NULL); } return(NULL); } @@ -2193,6 +2208,13 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { case XML_SGML_DOCUMENT_NODE: #endif return(NULL); + case XML_NAMESPACE_DECL: + /* + * TODO !!! may require extending struct _xmlNs with + * parent field + * C.f. Infoset case... + */ + return(NULL); } return(NULL); }