summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2007-06-13 20:47:19 +0200
committerMike Hommey <glandium@debian.org>2007-06-13 20:47:19 +0200
commit58f9d16e3a77d5207d9ccc413b61e2cb45190018 (patch)
treef190471ceb2bc35c076cc65159141813da73c8ee
parent789259a1b6850d30acffbb62b11456b9ed7a8f59 (diff)
downloadlibxml2-58f9d16e3a77d5207d9ccc413b61e2cb45190018.tar.gz
Load /tmp/libxml2-2.6.29 intoupstream/2.6.29.dfsg
libxml2/branches/upstream/current.
-rw-r--r--ChangeLog177
-rw-r--r--HTMLparser.c23
-rw-r--r--HTMLtree.c4
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.in2
-rw-r--r--NEWS26
-rw-r--r--SAX2.c42
-rw-r--r--catalog.c23
-rwxr-xr-xconfigure8
-rw-r--r--configure.in8
-rw-r--r--doc/APIchunk10.html3
-rw-r--r--doc/APIchunk12.html2
-rw-r--r--doc/APIchunk13.html1
-rw-r--r--doc/APIchunk24.html2
-rw-r--r--doc/APIchunk26.html1
-rw-r--r--doc/APIchunk5.html1
-rw-r--r--doc/APIfiles.html1
-rw-r--r--doc/APIfunctions.html2
-rw-r--r--doc/APIsymbols.html1
-rw-r--r--doc/devhelp/libxml2-threads.html11
-rw-r--r--doc/devhelp/libxml2-uri.html7
-rw-r--r--doc/devhelp/libxml2.devhelp1
-rw-r--r--doc/examples/Makefile.am2
-rw-r--r--doc/examples/Makefile.in2
-rw-r--r--doc/html/libxml-threads.html5
-rw-r--r--doc/html/libxml-uri.html7
-rw-r--r--doc/libxml2-api.xml21
-rw-r--r--doc/libxml2.xsa77
-rw-r--r--doc/news.html25
-rw-r--r--doc/xml.html27
-rw-r--r--encoding.c13
-rw-r--r--include/libxml/threads.h4
-rw-r--r--include/libxml/uri.h7
-rw-r--r--include/libxml/xmlversion.h11
-rw-r--r--include/libxml/xmlversion.h.in3
-rw-r--r--include/win32config.h9
-rw-r--r--libxml.h17
-rw-r--r--libxml2.spec6
-rw-r--r--list.c4
-rw-r--r--nanohttp.c9
-rw-r--r--parser.c24
-rw-r--r--python/libxml2-py.c32
-rw-r--r--python/libxml2-python-api.xml11
-rwxr-xr-xpython/setup.py2
-rw-r--r--python/types.c3
-rw-r--r--relaxng.c3
-rw-r--r--schematron.c4
-rw-r--r--testapi.c2
-rw-r--r--threads.c6
-rw-r--r--tree.c5
-rw-r--r--uri.c65
-rw-r--r--valid.c23
-rw-r--r--win32/Makefile.msvc81
-rw-r--r--win32/configure.js12
-rw-r--r--xmlIO.c13
-rw-r--r--xmlregexp.c6
-rw-r--r--xmlsave.c1
-rw-r--r--xmlwriter.c274
-rw-r--r--xpath.c50
-rw-r--r--xstc/Makefile.am6
-rw-r--r--xstc/Makefile.in6
61 files changed, 922 insertions, 304 deletions
diff --git a/ChangeLog b/ChangeLog
index b6a6855..5f5d9a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,180 @@
+Tue Jun 12 18:17:28 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * doc/* configure.in NEWS: release of libxml2 2.6.28
+ * valid.c: patch from Dagfinn I. Mannsåker for idness of name
+ in HTML, c.f. bug #305885.
+
+Tue Jun 12 17:14:08 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * SAX2.c: fixing bug #319964, parsing of HTML attribute really
+ should not have namespace processing.
+
+Tue Jun 12 16:42:14 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: fixed the push mode when a big comment occurs before
+ an internal subset, should close bug #438835
+ * test/comment6.xml result//comment6.xml*: added a special
+ test in the regression suite
+
+Tue Jun 12 15:41:09 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: fix bug #414846 where invalid characters in attributes
+ would sometimes not be detected.
+ * test/errors/attr4.xml result/errors/attr4.xml*: added a specific
+ test case to the regression tests
+
+Tue Jun 12 14:23:24 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * xstc/Makefile.am: apply patch from Ryan Hill to cope with changes
+ in GNU tar, should fix #396751
+
+Tue Jun 12 12:03:36 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * python/types.c: try to allow compilation on old python version
+ should fix #398125
+
+Tue Jun 12 11:48:15 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * HTMLtree.c: htmlNodeDumpFormatOutput didn't handle XML_ATTRIBUTE_NODe
+ fixes bug #438390
+
+Tue Jun 12 11:37:55 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * xmlIO.c: workaround misgenerated file: URIs c.f. #437385
+
+Tue Jun 12 11:22:47 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * relaxng.c: fixed bug #407436 a crash in a specific case of
+ Relax-NG validation
+
+Tue Jun 12 11:12:50 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * catalog.c: fixed bug #383687, some case of recursion on next
+ were not caught in the catalog code.
+
+Tue Jun 12 10:37:42 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * HTMLparser.c: fixed bug #381877, avoid reading over the end
+ of stream when generating an UTF-8 encoding error.
+
+Tue Jun 12 10:16:48 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: fixed bug #366161, trivially added the check in
+ xmlCtxtReset()
+
+Fri Jun 8 21:48:21 CEST 2007 Rob Richards <rrichards@ctindustries.net>
+
+ * win32/configure.js win32/Makefile.msvc: add --vcmanifest flag (yes/no)
+ for VC8 build support to embed manifest within files. Under MS VC, build
+ libxml2_a_dll.lib by default (LIBXML_STATIC_FOR_DLL flag).
+
+Fri Jun 8 21:37:46 CEST 2007 Rob Richards <rrichards@ctindustries.net>
+
+ * threads.c include/libxml/threads.h: use specified calling convention
+ for xmlDllMain. Old SDKs (VC6) only support InterlockedCompareExchange.
+ add xmlDllMain to header for win32 when building for static dll
+
+Fri Jun 8 10:51:28 CEST 2007 Rob Richards <rrichards@ctindustries.net>
+
+ * xmlwriter.c: fixed problem with namespace declaration being
+ written more than once per element start tag
+
+Wed Jun 6 10:18:28 PDT 2007 William Brack <wbrack@mmm.com.hk>
+
+ * xpath.c: fixed problem with xmlXPathNodeSetSort;
+ fixed problem with xmlXPathNodeTrailingSorted (both bug#413451)
+
+Wed May 30 22:05:08 PDT 2007 William Brack <wbrack@mmm.com.hk>
+
+ * xpath.c: fixed problem with string value for PI node
+ (bug #442275)
+
+Mon May 28 16:14:50 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * uri.c: fix bug reported by François Delyon
+
+Tue May 22 08:59:48 PDT 2007 William Brack <wbrack@mmm.com.hk>
+
+ * encoding.c: Fixed typo in xmlCharEncFirstLine pointed out
+ by Mark Rowe (bug #440159)
+ * include/libxml/xmlversion.h.in: Added check for definition of
+ _POSIX_C_SOURCE to avoid warnings on Apple OS/X (patch from
+ Wendy Doyle and Mark Rowe, bug #346675)
+ * schematron.c, testapi.c, tree.c, xmlIO.c, xmlsave.c: minor
+ changes to fix compilation warnings - no change to logic.
+
+Tue May 15 22:18:08 PDT 2007 William Brack <wbrack@mmm.com.hk>
+
+ * nanohttp.c: small enhancement to last fix, pointed out
+ by Alex Cornejo
+
+Tue May 15 12:38:38 PDT 2007 William Brack <wbrack@mmm.com.hk>
+
+ * nanohttp.c: fixed problem on gzip streams (bug #438045)
+ * xpath.c: fixed minor spot of redundant code - no logic change.
+
+Fri May 11 22:45:18 HKT 2007 William Brack <wbrack@mmm.com.hk>
+
+ * xpath.c: enhanced the coding for xmlXPathCastNumberToString
+ in order to produce the required number of significant digits
+ (bug #437179)
+
+Thu May 10 01:52:42 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * list.c: applied patch to fix xmlListAppend() from
+ Georges-André SILBER
+ * valid.c: also fix the place wher it was called.
+
+Wed May 2 18:47:33 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: tried to fix an error problem on entity content failure
+ reported by Michael Day
+
+Wed May 2 18:23:35 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * configure.in: typo patch from Bjorn Reese
+
+Wed May 2 18:12:58 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * HTMLparser.c: applied patch from Michael Day to add support for
+ <embed>
+
+Thu Apr 26 10:58:50 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * HTMLparser.c: Jean-Daniel Dupas pointed a couple of problems
+ in htmlCreateDocParserCtxt.
+
+Thu Apr 26 10:36:26 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * uri.c include/libxml/uri.h: patch from Richard Jones to save
+ the query part in raw form.
+ * libxml2-python-api.xml: also added accessor for the python bindings
+
+Wed Apr 25 15:57:32 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * xstc/Makefile.am doc/examples/Makefile.am Makefile.am: applied
+ patch from Richard Jones to for the silent flag on valgrind
+ when doing "make valgrind"
+ * xmlregexp.c: raise a regexp error when '\' is misused to escape
+ a standard character.
+
+Tue Apr 24 20:15:14 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * tree.c: Richard Jones reported xmlBufferAdd (buf, "", -1), fixing it
+
+Tue Apr 24 10:59:28 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * uri.c: fix xmlURIUnescapeString comments which was confusing
+
+Wed Apr 18 09:52:25 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * include/win32config.h libxml.h: new patch from Andreas Stricke to
+ better integrate support for Windows CE
+
+Tue Apr 17 16:50:12 CEST 2007 Daniel Veillard <daniel@veillard.com>
+
+ * doc/* configure.in NEWS: release of libxml2 2.6.28
+
Tue Apr 17 14:47:42 CEST 2007 Daniel Veillard <daniel@veillard.com>
* catalog.c libxml.h win32/wince/wincecompat.h win32/wince/wincecompat.c
diff --git a/HTMLparser.c b/HTMLparser.c
index 8f2f776..91d54c7 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -401,9 +401,13 @@ encoding_error:
{
char buffer[150];
- snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
- ctxt->input->cur[0], ctxt->input->cur[1],
- ctxt->input->cur[2], ctxt->input->cur[3]);
+ if (ctxt->input->end - ctxt->input->cur >= 4) {
+ snprintf(buffer, 149, "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ ctxt->input->cur[0], ctxt->input->cur[1],
+ ctxt->input->cur[2], ctxt->input->cur[3]);
+ } else {
+ snprintf(buffer, 149, "Bytes: 0x%02X\n", ctxt->input->cur[0]);
+ }
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
"Input is not proper UTF-8, indicate encoding !\n",
BAD_CAST buffer, NULL);
@@ -472,8 +476,8 @@ htmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
#define NB_FONTSTYLE 8
#define PHRASE "em", "strong", "dfn", "code", "samp", "kbd", "var", "cite", "abbr", "acronym"
#define NB_PHRASE 10
-#define SPECIAL "a", "img", "applet", "object", "font", "basefont", "br", "script", "map", "q", "sub", "sup", "span", "bdo", "iframe"
-#define NB_SPECIAL 15
+#define SPECIAL "a", "img", "applet", "embed", "object", "font", "basefont", "br", "script", "map", "q", "sub", "sup", "span", "bdo", "iframe"
+#define NB_SPECIAL 16
#define INLINE PCDATA FONTSTYLE PHRASE SPECIAL FORMCTRL
#define NB_INLINE NB_PCDATA + NB_FONTSTYLE + NB_PHRASE + NB_SPECIAL + NB_FORMCTRL
#define BLOCK HEADING, LIST "pre", "p", "dl", "div", "center", "noscript", "noframes", "blockquote", "form", "isindex", "hr", "table", "fieldset", "address"
@@ -572,6 +576,7 @@ static const char* const version_attr[] = { "version", NULL } ;
static const char* const html_content[] = { "head", "body", "frameset", NULL } ;
static const char* const iframe_attrs[] = { COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "scrolling", "align", "height", "width", NULL } ;
static const char* const img_attrs[] = { ATTRS, "longdesc", "name", "height", "width", "usemap", "ismap", NULL } ;
+static const char* const embed_attrs[] = { COREATTRS, "align", "alt", "border", "code", "codebase", "frameborder", "height", "hidden", "hspace", "name", "palette", "pluginspace", "pluginurl", "src", "type", "units", "vspace", "width", NULL } ;
static const char* const input_attrs[] = { ATTRS, "type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "ismap", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", "accept", NULL } ;
static const char* const prompt_attrs[] = { COREATTRS, I18N, "prompt", NULL } ;
static const char* const label_attrs[] = { ATTRS, "for", "accesskey", "onfocus", "onblur", NULL } ;
@@ -706,6 +711,9 @@ html40ElementTable[] = {
{ "em", 0, 3, 0, 0, 0, 0, 1, "emphasis",
DECL html_inline, NULL, DECL html_attrs, NULL, NULL
},
+{ "embed", 0, 1, 2, 0, 1, 1, 1, "generic embedded object ",
+ EMPTY, NULL, DECL embed_attrs, NULL, NULL
+},
{ "fieldset", 0, 0, 0, 0, 0, 0, 0, "form control group ",
DECL fieldset_contents , NULL, DECL html_attrs, NULL, NULL
},
@@ -4391,8 +4399,7 @@ htmlCreateMemoryParserCtxt(const char *buffer, int size) {
* Returns the new parser context or NULL
*/
static htmlParserCtxtPtr
-htmlCreateDocParserCtxt(const xmlChar *cur,
- const char *encoding ATTRIBUTE_UNUSED) {
+htmlCreateDocParserCtxt(const xmlChar *cur, const char *encoding) {
int len;
htmlParserCtxtPtr ctxt;
@@ -4400,6 +4407,8 @@ htmlCreateDocParserCtxt(const xmlChar *cur,
return(NULL);
len = xmlStrlen(cur);
ctxt = htmlCreateMemoryParserCtxt((char *)cur, len);
+ if (ctxt == NULL)
+ return(NULL);
if (encoding != NULL) {
xmlCharEncoding enc;
diff --git a/HTMLtree.c b/HTMLtree.c
index c1e5a0a..e79d118 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -780,6 +780,10 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
return;
}
+ if (cur->type == XML_ATTRIBUTE_NODE) {
+ htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding);
+ return;
+ }
if (cur->type == HTML_TEXT_NODE) {
if (cur->content != NULL) {
if (((cur->name == (const xmlChar *)xmlStringText) ||
diff --git a/Makefile.am b/Makefile.am
index 6676040..d1feb94 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -167,7 +167,7 @@ tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TES
valgrind:
@echo '## Running the regression tests under Valgrind'
@echo '## Go get a cup of coffee it is gonna take a while ...'
- $(MAKE) CHECKER='valgrind' tests
+ $(MAKE) CHECKER='valgrind -q' tests
APItests: testapi$(EXEEXT)
@echo "## Running the API regression tests this may take a little while"
diff --git a/Makefile.in b/Makefile.in
index e49ced2..d2e51b3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1438,7 +1438,7 @@ tests: XMLtests XMLenttests NStests IDtests Errtests APItests @READER_TEST@ @TES
valgrind:
@echo '## Running the regression tests under Valgrind'
@echo '## Go get a cup of coffee it is gonna take a while ...'
- $(MAKE) CHECKER='valgrind' tests
+ $(MAKE) CHECKER='valgrind -q' tests
APItests: testapi$(EXEEXT)
@echo "## Running the API regression tests this may take a little while"
diff --git a/NEWS b/NEWS
index fa7ae09..0bad177 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,32 @@ ChangeLog.html
to the SVN at
http://svn.gnome.org/viewcvs/libxml2/trunk/
code base.Here is the list of public releases:
+2.6.29: Jun 12 2007:
+ - Portability: patches from Andreas Stricke for WinCEi,
+ fix compilation warnings (William Brack), avoid warnings on Apple OS/X
+ (Wendy Doyle and Mark Rowe), Windows compilation and threading
+ improvements (Rob Richards), compilation against old Python versions,
+ new GNU tar changes (Ryan Hill)
+ - Documentation: xmlURIUnescapeString comment,
+ - Bugfixes: xmlBufferAdd problem (Richard Jones), 'make valgrind'
+ flag fix (Richard Jones), regexp interpretation of \,
+ htmlCreateDocParserCtxt (Jean-Daniel Dupas), configure.in
+ typo (Bjorn Reese), entity content failure, xmlListAppend() fix
+ (Georges-André Silber), XPath number serialization (William Brack),
+ nanohttp gzipped stream fix (William Brack and Alex Cornejo),
+ xmlCharEncFirstLine typo (Mark Rowe), uri bug (François Delyon),
+ XPath string value of PI nodes (William Brack), XPath node set
+ sorting bugs (William Brack), avoid outputting namespace decl
+ dups in the writer (Rob Richards), xmlCtxtReset bug, UTF-8 encoding
+ error handling, recustion on next in catalogs, fix a Relax-NG crash,
+ workaround wrong file: URIs, htmlNodeDumpFormatOutput on attributes,
+ invalid character in attribute detection bug, big comments before
+ internal subset streaming bug, HTML parsing of attributes with : in
+ the name
+ - Improvement: keep URI query parts in raw form (Richard Jones),
+ embed tag support in HTML (Michael Day)
+
+
2.6.28: Apr 17 2007:
- Documentation: comment fixes (Markus Keim), xpath comments fixes too
(James Dennett)
diff --git a/SAX2.c b/SAX2.c
index 7d4ab64..9739831 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -1059,25 +1059,31 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
xmlChar *nval;
xmlNsPtr namespace;
- /*
- * Split the full name into a namespace prefix and the tag name
- */
- name = xmlSplitQName(ctxt, fullname, &ns);
- if ((name != NULL) && (name[0] == 0)) {
- if (xmlStrEqual(ns, BAD_CAST "xmlns")) {
- xmlNsErrMsg(ctxt, XML_ERR_NS_DECL_ERROR,
- "invalid namespace declaration '%s'\n",
- fullname, NULL);
- } else {
- xmlNsWarnMsg(ctxt, XML_WAR_NS_COLUMN,
- "Avoid attribute ending with ':' like '%s'\n",
- fullname, NULL);
- }
- if (ns != NULL)
- xmlFree(ns);
- ns = NULL;
- xmlFree(name);
+ if (ctxt->html) {
name = xmlStrdup(fullname);
+ ns = NULL;
+ namespace = NULL;
+ } else {
+ /*
+ * Split the full name into a namespace prefix and the tag name
+ */
+ name = xmlSplitQName(ctxt, fullname, &ns);
+ if ((name != NULL) && (name[0] == 0)) {
+ if (xmlStrEqual(ns, BAD_CAST "xmlns")) {
+ xmlNsErrMsg(ctxt, XML_ERR_NS_DECL_ERROR,
+ "invalid namespace declaration '%s'\n",
+ fullname, NULL);
+ } else {
+ xmlNsWarnMsg(ctxt, XML_WAR_NS_COLUMN,
+ "Avoid attribute ending with ':' like '%s'\n",
+ fullname, NULL);
+ }
+ if (ns != NULL)
+ xmlFree(ns);
+ ns = NULL;
+ xmlFree(name);
+ name = xmlStrdup(fullname);
+ }
}
if (name == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElement");
diff --git a/catalog.c b/catalog.c
index 95ebee8..ee3f8f2 100644
--- a/catalog.c
+++ b/catalog.c
@@ -1828,6 +1828,8 @@ xmlCatalogXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
if (ret != NULL) {
catal->depth--;
return(ret);
+ } else if (catal->depth > MAX_CATAL_DEPTH) {
+ return(NULL);
}
}
}
@@ -1868,6 +1870,13 @@ xmlCatalogXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) {
if (URI == NULL)
return(NULL);
+ if (catal->depth > MAX_CATAL_DEPTH) {
+ xmlCatalogErr(catal, NULL, XML_CATALOG_RECURSION,
+ "Detected recursion in catalog %s\n",
+ catal->name, NULL, NULL);
+ return(NULL);
+ }
+
/*
* First tries steps 2/ 3/ 4/ if a system ID is provided.
*/
@@ -2053,16 +2062,18 @@ xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
if (catal->children != NULL) {
ret = xmlCatalogXMLResolve(catal->children, pubID, sysID);
if (ret != NULL) {
- if (normid != NULL)
- xmlFree(normid);
- return(ret);
- }
+ break;
+ } else if ((catal->children != NULL) &&
+ (catal->children->depth > MAX_CATAL_DEPTH)) {
+ ret = NULL;
+ break;
+ }
}
}
catal = catal->next;
}
- if (normid != NULL)
- xmlFree(normid);
+ if (normid != NULL)
+ xmlFree(normid);
return(ret);
}
diff --git a/configure b/configure
index 19453ad..7fd6150 100755
--- a/configure
+++ b/configure
@@ -1618,7 +1618,7 @@ host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=6
-LIBXML_MICRO_VERSION=28
+LIBXML_MICRO_VERSION=29
LIBXML_MICRO_VERSION_SUFFIX=
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
@@ -19710,7 +19710,7 @@ fi;
if test "$with_schemas" = "yes"
then
with_pattern=yes
- with_regexp=yes
+ with_regexps=yes
fi
if test "$with_schematron" = "yes"
then
@@ -19805,9 +19805,9 @@ then
then
with_readline=no
fi
- if test "$with_regexp" = ""
+ if test "$with_regexps" = ""
then
- with_regexp=no
+ with_regexps=no
fi
if test "$with_run_debug" = ""
then
diff --git a/configure.in b/configure.in
index c355498..866df62 100644
--- a/configure.in
+++ b/configure.in
@@ -5,7 +5,7 @@ AC_CANONICAL_HOST
LIBXML_MAJOR_VERSION=2
LIBXML_MINOR_VERSION=6
-LIBXML_MICRO_VERSION=28
+LIBXML_MICRO_VERSION=29
LIBXML_MICRO_VERSION_SUFFIX=
LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
@@ -170,7 +170,7 @@ dnl
if test "$with_schemas" = "yes"
then
with_pattern=yes
- with_regexp=yes
+ with_regexps=yes
fi
if test "$with_schematron" = "yes"
then
@@ -268,9 +268,9 @@ then
then
with_readline=no
fi
- if test "$with_regexp" = ""
+ if test "$with_regexps" = ""
then
- with_regexp=no
+ with_regexps=no
fi
if test "$with_run_debug" = ""
then
diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html
index c55e04a..38a6660 100644
--- a/doc/APIchunk10.html
+++ b/doc/APIchunk10.html
@@ -453,7 +453,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlParserHandlePEReference">xmlParserHandlePEReference</a><br />
</dd><dt>appearing</dt><dd><a href="html/libxml-valid.html#xmlValidatePopElement">xmlValidatePopElement</a><br />
<a href="html/libxml-valid.html#xmlValidatePushElement">xmlValidatePushElement</a><br />
-</dd><dt>appears</dt><dd><a href="html/libxml-xmlregexp.html#xmlExpGetStart">xmlExpGetStart</a><br />
+</dd><dt>appears</dt><dd><a href="html/libxml-uri.html#_xmlURI">_xmlURI</a><br />
+<a href="html/libxml-xmlregexp.html#xmlExpGetStart">xmlExpGetStart</a><br />
<a href="html/libxml-parserInternals.html#xmlParseCharData">xmlParseCharData</a><br />
<a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
diff --git a/doc/APIchunk12.html b/doc/APIchunk12.html
index fb3ad79..daaf7ce 100644
--- a/doc/APIchunk12.html
+++ b/doc/APIchunk12.html
@@ -124,6 +124,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-catalog.html#xmlLoadCatalogs">xmlLoadCatalogs</a><br />
</dd><dt>category</dt><dd><a href="html/libxml-xmlunicode.html#xmlUCSIsCat">xmlUCSIsCat</a><br />
</dd><dt>cause</dt><dd><a href="html/libxml-debugXML.html#xmlShellPrintXPathError">xmlShellPrintXPathError</a><br />
+</dd><dt>caution</dt><dd><a href="html/libxml-uri.html#_xmlURI">_xmlURI</a><br />
</dd><dt>cdata-section-</dt><dd><a href="html/libxml-pattern.html#xmlStreamPushNode">xmlStreamPushNode</a><br />
<a href="html/libxml-pattern.html#xmlStreamWantsAnyNode">xmlStreamWantsAnyNode</a><br />
</dd><dt>ceiling</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathCeilingFunction">xmlXPathCeilingFunction</a><br />
@@ -222,7 +223,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlParseElementMixedContentDecl">xmlParseElementMixedContentDecl</a><br />
<a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
<a href="html/libxml-uri.html#xmlURIEscape">xmlURIEscape</a><br />
-<a href="html/libxml-uri.html#xmlURIUnescapeString">xmlURIUnescapeString</a><br />
<a href="html/libxml-valid.html#xmlValidateAttributeDecl">xmlValidateAttributeDecl</a><br />
<a href="html/libxml-valid.html#xmlValidateDocument">xmlValidateDocument</a><br />
<a href="html/libxml-valid.html#xmlValidateDocumentFinal">xmlValidateDocumentFinal</a><br />
diff --git a/doc/APIchunk13.html b/doc/APIchunk13.html
index 834cde1..c0be627 100644
--- a/doc/APIchunk13.html
+++ b/doc/APIchunk13.html
@@ -232,6 +232,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpathInternals.html#xmlXPathNotEqualValues">xmlXPathNotEqualValues</a><br />
</dd><dt>deprecated</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_LEGACY_ENABLED">LIBXML_LEGACY_ENABLED</a><br />
<a href="html/libxml-HTMLparser.html#_htmlElemDesc">_htmlElemDesc</a><br />
+<a href="html/libxml-uri.html#_xmlURI">_xmlURI</a><br />
<a href="html/libxml-HTMLparser.html#htmlAttrAllowed">htmlAttrAllowed</a><br />
<a href="html/libxml-HTMLparser.html#htmlElementAllowedHere">htmlElementAllowedHere</a><br />
<a href="html/libxml-HTMLparser.html#htmlElementStatusHere">htmlElementStatusHere</a><br />
diff --git a/doc/APIchunk24.html b/doc/APIchunk24.html
index a965455..d853a75 100644
--- a/doc/APIchunk24.html
+++ b/doc/APIchunk24.html
@@ -56,6 +56,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlReplaceNode">xmlReplaceNode</a><br />
<a href="html/libxml-xmlstring.html#xmlStrEqual">xmlStrEqual</a><br />
<a href="html/libxml-xmlstring.html#xmlStrncatNew">xmlStrncatNew</a><br />
+<a href="html/libxml-uri.html#xmlURIUnescapeString">xmlURIUnescapeString</a><br />
<a href="html/libxml-xpath.html#xmlXPathCmpNodes">xmlXPathCmpNodes</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathIdFunction">xmlXPathIdFunction</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathLangFunction">xmlXPathLangFunction</a><br />
@@ -393,6 +394,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlSkipBlankChars">xmlSkipBlankChars</a><br />
</dd><dt>slot</dt><dd><a href="html/libxml-xpath.html#xmlXPathContextSetCache">xmlXPathContextSetCache</a><br />
</dd><dt>slots</dt><dd><a href="html/libxml-xpath.html#xmlXPathContextSetCache">xmlXPathContextSetCache</a><br />
+</dd><dt>smaller</dt><dd><a href="html/libxml-uri.html#xmlURIUnescapeString">xmlURIUnescapeString</a><br />
</dd><dt>smallest</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathCeilingFunction">xmlXPathCeilingFunction</a><br />
</dd><dt>socket</dt><dd><a href="html/libxml-xmlIO.html#xmlCheckFilename">xmlCheckFilename</a><br />
<a href="html/libxml-nanoftp.html#xmlNanoFTPGetSocket">xmlNanoFTPGetSocket</a><br />
diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html
index 5606555..e5b01d0 100644
--- a/doc/APIchunk26.html
+++ b/doc/APIchunk26.html
@@ -240,7 +240,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#xmlParserValidityWarning">xmlParserValidityWarning</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderIsValid">xmlTextReaderIsValid</a><br />
<a href="html/libxml-uri.html#xmlURIEscape">xmlURIEscape</a><br />
-<a href="html/libxml-uri.html#xmlURIUnescapeString">xmlURIUnescapeString</a><br />
<a href="html/libxml-valid.html#xmlValidGetValidElements">xmlValidGetValidElements</a><br />
<a href="html/libxml-valid.html#xmlValidateDocumentFinal">xmlValidateDocumentFinal</a><br />
<a href="html/libxml-valid.html#xmlValidateNotationDecl">xmlValidateNotationDecl</a><br />
diff --git a/doc/APIchunk5.html b/doc/APIchunk5.html
index 9a6b23f..8bd78ca 100644
--- a/doc/APIchunk5.html
+++ b/doc/APIchunk5.html
@@ -77,7 +77,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlIO.html#xmlOutputMatchCallback">xmlOutputMatchCallback</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputOpenCallback">xmlOutputOpenCallback</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a><br />
-<a href="html/libxml-uri.html#xmlURIUnescapeString">xmlURIUnescapeString</a><br />
</dd><dt>OutputBufferCreateFilenameFunc</dt><dd><a href="html/libxml-globals.html#xmlOutputBufferCreateFilenameDefault">xmlOutputBufferCreateFilenameDefault</a><br />
</dd><dt>Override</dt><dd><a href="html/libxml-xmlmemory.html#xmlGcMemSetup">xmlGcMemSetup</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemSetup">xmlMemSetup</a><br />
diff --git a/doc/APIfiles.html b/doc/APIfiles.html
index 8a3f6d7..208205f 100644
--- a/doc/APIfiles.html
+++ b/doc/APIfiles.html
@@ -1242,6 +1242,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-schematron.html#xmlSchematronValidityErrorFunc">xmlSchematronValidityErrorFunc</a><br />
<a href="html/libxml-schematron.html#xmlSchematronValidityWarningFunc">xmlSchematronValidityWarningFunc</a><br />
</p><h2><a name="threads" id="threads">Module threads</a>:</h2><p><a href="html/libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a><br />
+<a href="html/libxml-threads.html#xmlDllMain">xmlDllMain</a><br />
<a href="html/libxml-threads.html#xmlFreeMutex">xmlFreeMutex</a><br />
<a href="html/libxml-threads.html#xmlFreeRMutex">xmlFreeRMutex</a><br />
<a href="html/libxml-threads.html#xmlGetGlobalState">xmlGetGlobalState</a><br />
diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html
index bbfd181..8d12650 100644
--- a/doc/APIfunctions.html
+++ b/doc/APIfunctions.html
@@ -607,6 +607,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-chvalid.html#xmlIsIdeographic">xmlIsIdeographic</a><br />
<a href="html/libxml-chvalid.html#xmlIsPubidChar">xmlIsPubidChar</a><br />
</p><h2>Type unsigned long:</h2><p><a href="html/libxml-nanoftp.html#ftpListCallback">ftpListCallback</a><br />
+<a href="html/libxml-threads.html#xmlDllMain">xmlDllMain</a><br />
<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateListSimpleTypeFacet">xmlSchemaValidateListSimpleTypeFacet</a><br />
</p><h2>Type unsigned long *:</h2><p><a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateLengthFacet">xmlSchemaValidateLengthFacet</a><br />
<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateLengthFacetWhtsp">xmlSchemaValidateLengthFacetWhtsp</a><br />
@@ -722,6 +723,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#xmlCtxtGetLastError">xmlCtxtGetLastError</a><br />
<a href="html/libxml-parser.html#xmlCtxtReadIO">xmlCtxtReadIO</a><br />
<a href="html/libxml-xmlerror.html#xmlCtxtResetLastError">xmlCtxtResetLastError</a><br />
+<a href="html/libxml-threads.html#xmlDllMain">xmlDllMain</a><br />
<a href="html/libxml-xmlIO.html#xmlFileClose">xmlFileClose</a><br />
<a href="html/libxml-xmlIO.html#xmlFileRead">xmlFileRead</a><br />
<a href="html/libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a><br />
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html
index 4cfeef8..2a64797 100644
--- a/doc/APIsymbols.html
+++ b/doc/APIsymbols.html
@@ -1891,6 +1891,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-dict.html#xmlDictQLookup">xmlDictQLookup</a><br />
<a href="html/libxml-dict.html#xmlDictReference">xmlDictReference</a><br />
<a href="html/libxml-dict.html#xmlDictSize">xmlDictSize</a><br />
+<a href="html/libxml-threads.html#xmlDllMain">xmlDllMain</a><br />
<a href="html/libxml-globals.html#xmlDoValidityCheckingDefaultValue">xmlDoValidityCheckingDefaultValue</a><br />
<a href="html/libxml-tree.html#xmlDoc">xmlDoc</a><br />
<a href="html/libxml-tree.html#xmlDocCopyNode">xmlDocCopyNode</a><br />
diff --git a/doc/devhelp/libxml2-threads.html b/doc/devhelp/libxml2-threads.html
index 66e5ba4..3ce5f93 100644
--- a/doc/devhelp/libxml2-threads.html
+++ b/doc/devhelp/libxml2-threads.html
@@ -58,10 +58,11 @@ int <a href="#xmlIsMainThread">xmlIsMainThread</a> (void);
void <a href="#xmlRMutexUnlock">xmlRMutexUnlock</a> (<a href="libxml2-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);
<a href="libxml2-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> <a href="#xmlGetGlobalState">xmlGetGlobalState</a> (void);
<a href="libxml2-threads.html#xmlMutexPtr">xmlMutexPtr</a> <a href="#xmlNewMutex">xmlNewMutex</a> (void);
-void <a href="#xmlRMutexLock">xmlRMutexLock</a> (<a href="libxml2-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);
-void <a href="#xmlInitThreads">xmlInitThreads</a> (void);
-void <a href="#xmlUnlockLibrary">xmlUnlockLibrary</a> (void);
+int <a href="#xmlDllMain">xmlDllMain</a> (void * hinstDLL, <br/> unsigned long fdwReason, <br/> void * lpvReserved);
void <a href="#xmlFreeMutex">xmlFreeMutex</a> (<a href="libxml2-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);
+void <a href="#xmlUnlockLibrary">xmlUnlockLibrary</a> (void);
+void <a href="#xmlInitThreads">xmlInitThreads</a> (void);
+void <a href="#xmlRMutexLock">xmlRMutexLock</a> (<a href="libxml2-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);
</pre>
</div>
<div class="refsect1" lang="en">
@@ -94,6 +95,10 @@ The content of this structure is not made public by the API.
</pre><p>xmlCleanupThreads() is used to to cleanup all the thread related data of the libxml2 library once processing has ended.</p>
</div>
<hr/>
+ <div class="refsect2" lang="en"><h3><a name="xmlDllMain"/>xmlDllMain ()</h3><pre class="programlisting">int xmlDllMain (void * hinstDLL, <br/> unsigned long fdwReason, <br/> void * lpvReserved)<br/>
+</pre><p/>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>hinstDLL</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>fdwReason</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>lpvReserved</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+ <hr/>
<div class="refsect2" lang="en"><h3><a name="xmlFreeMutex"/>xmlFreeMutex ()</h3><pre class="programlisting">void xmlFreeMutex (<a href="libxml2-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok)<br/>
</pre><p>xmlFreeMutex() is used to reclaim resources associated with a libxml2 token struct.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>tok</tt></i>:</span></td><td>the simple mutex</td></tr></tbody></table></div></div>
diff --git a/doc/devhelp/libxml2-uri.html b/doc/devhelp/libxml2-uri.html
index 33f32fa..c67dacf 100644
--- a/doc/devhelp/libxml2-uri.html
+++ b/doc/devhelp/libxml2-uri.html
@@ -76,9 +76,10 @@ int <a href="#xmlParseURIReference">xmlParseURIReference</a> (<a href="libxml2-
char * user : the user part
int port : the port number
char * path : the path string
- char * query : the query string
+ char * query : the query string (deprecated - use with caution)
char * fragment : the fragment identifier
int cleanup : parsing potentially unclean URI
+ char * query_raw : the query string (as it appears in the URI)
} xmlURI;
</pre><p/>
</div>
@@ -144,8 +145,8 @@ int <a href="#xmlParseURIReference">xmlParseURIReference</a> (<a href="libxml2-
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>string to escape</td></tr><tr><td><span class="term"><i><tt>list</tt></i>:</span></td><td>exception list string of chars not to escape</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new escaped string or NULL in case of error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlURIUnescapeString"/>xmlURIUnescapeString ()</h3><pre class="programlisting">char * xmlURIUnescapeString (const char * str, <br/> int len, <br/> char * target)<br/>
-</pre><p>Unescaping routine, does not do validity checks ! Output is direct unsigned char translation of %XX values (no encoding)</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string to unescape</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the length in bytes to unescape (or &lt;= 0 to indicate full string)</td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td>optional destination buffer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an copy of the string, but unescaped</td></tr></tbody></table></div></div>
+</pre><p>Unescaping routine, but does not check that the string is an URI. The output is a direct unsigned char translation of %XX values (no encoding) Note that the length of the result can only be smaller or same size as the input string.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string to unescape</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the length in bytes to unescape (or &lt;= 0 to indicate full string)</td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td>optional destination buffer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a copy of the string, but unescaped, will return NULL only in case of error</td></tr></tbody></table></div></div>
<hr/>
</div>
</div>
diff --git a/doc/devhelp/libxml2.devhelp b/doc/devhelp/libxml2.devhelp
index 6a3841c..a932cdf 100644
--- a/doc/devhelp/libxml2.devhelp
+++ b/doc/devhelp/libxml2.devhelp
@@ -2193,6 +2193,7 @@
<function name="xmlDictQLookup ()" link="libxml2-dict.html#xmlDictQLookup"/>
<function name="xmlDictReference ()" link="libxml2-dict.html#xmlDictReference"/>
<function name="xmlDictSize ()" link="libxml2-dict.html#xmlDictSize"/>
+ <function name="xmlDllMain ()" link="libxml2-threads.html#xmlDllMain"/>
<function name="xmlDocCopyNode ()" link="libxml2-tree.html#xmlDocCopyNode"/>
<function name="xmlDocCopyNodeList ()" link="libxml2-tree.html#xmlDocCopyNodeList"/>
<function name="xmlDocDump ()" link="libxml2-tree.html#xmlDocDump"/>
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index cd9f4ef..ea23621 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -96,7 +96,7 @@ xpath2_DEPENDENCIES= $(DEPS)
xpath2_LDADD= @RDL_LIBS@ $(LDADDS)
valgrind:
- $(MAKE) CHECKER='valgrind' tests
+ $(MAKE) CHECKER='valgrind -q' tests
tests: $(noinst_PROGRAMS)
@(echo '## examples regression tests')
diff --git a/doc/examples/Makefile.in b/doc/examples/Makefile.in
index f8af861..5fd6a3a 100644
--- a/doc/examples/Makefile.in
+++ b/doc/examples/Makefile.in
@@ -707,7 +707,7 @@ install-data-local:
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
valgrind:
- $(MAKE) CHECKER='valgrind' tests
+ $(MAKE) CHECKER='valgrind -q' tests
tests: $(noinst_PROGRAMS)
@(echo '## examples regression tests')
diff --git a/doc/html/libxml-threads.html b/doc/html/libxml-threads.html
index eebcf3c..8bb2cbf 100644
--- a/doc/html/libxml-threads.html
+++ b/doc/html/libxml-threads.html
@@ -17,6 +17,7 @@ The content of this structure is not made public by the API.
The content of this structure is not made public by the API.
</pre><pre class="programlisting">Typedef <a href="libxml-threads.html#xmlRMutex">xmlRMutex</a> * <a name="xmlRMutexPtr" id="xmlRMutexPtr">xmlRMutexPtr</a>
</pre><pre class="programlisting">void <a href="#xmlCleanupThreads">xmlCleanupThreads</a> (void)</pre>
+<pre class="programlisting">int <a href="#xmlDllMain">xmlDllMain</a> (void * hinstDLL, <br /> unsigned long fdwReason, <br /> void * lpvReserved)</pre>
<pre class="programlisting">void <a href="#xmlFreeMutex">xmlFreeMutex</a> (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok)</pre>
<pre class="programlisting">void <a href="#xmlFreeRMutex">xmlFreeRMutex</a> (<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok)</pre>
<pre class="programlisting"><a href="libxml-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> <a href="#xmlGetGlobalState">xmlGetGlobalState</a> (void)</pre>
@@ -38,7 +39,9 @@ The content of this structure is not made public by the API.
The content of this structure is not made public by the API.
}</pre><h3><a name="xmlCleanupThreads" id="xmlCleanupThreads"></a>Function: xmlCleanupThreads</h3><pre class="programlisting">void xmlCleanupThreads (void)<br />
</pre><p>xmlCleanupThreads() is used to to cleanup all the thread related data of the libxml2 library once processing has ended.</p>
-<h3><a name="xmlFreeMutex" id="xmlFreeMutex"></a>Function: xmlFreeMutex</h3><pre class="programlisting">void xmlFreeMutex (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok)<br />
+<h3><a name="xmlDllMain" id="xmlDllMain"></a>Function: xmlDllMain</h3><pre class="programlisting">int xmlDllMain (void * hinstDLL, <br /> unsigned long fdwReason, <br /> void * lpvReserved)<br />
+</pre><p></p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>hinstDLL</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>fdwReason</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>lpvReserved</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlFreeMutex" id="xmlFreeMutex"></a>Function: xmlFreeMutex</h3><pre class="programlisting">void xmlFreeMutex (<a href="libxml-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok)<br />
</pre><p>xmlFreeMutex() is used to reclaim resources associated with a libxml2 token struct.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>tok</tt></i>:</span></td><td>the simple mutex</td></tr></tbody></table></div><h3><a name="xmlFreeRMutex" id="xmlFreeRMutex"></a>Function: xmlFreeRMutex</h3><pre class="programlisting">void xmlFreeRMutex (<a href="libxml-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok)<br />
</pre><p>xmlRFreeMutex() is used to reclaim resources associated with a reentrant mutex.</p>
diff --git a/doc/html/libxml-uri.html b/doc/html/libxml-uri.html
index fa7ee19..1c668e8 100644
--- a/doc/html/libxml-uri.html
+++ b/doc/html/libxml-uri.html
@@ -36,9 +36,10 @@ A:link, A:visited, A:active { text-decoration: underline }
char * user : the user part
int port : the port number
char * path : the path string
- char * query : the query string
+ char * query : the query string (deprecated - use with
char * fragment : the fragment identifier
int cleanup : parsing potentially unclean URI
+ char * query_raw : the query string (as it appears in the
}</pre><h3><a name="xmlBuildRelativeURI" id="xmlBuildRelativeURI"></a>Function: xmlBuildRelativeURI</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlBuildRelativeURI (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * base)<br />
</pre><p>Expresses the URI of the <a href="libxml-SAX.html#reference">reference</a> in terms relative to the base. Some examples of this operation include: base = "http://site1.com/docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif pic1.gif http://site2.com/docs/pic1.gif http://site2.com/docs/pic1.gif base = "docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif http://site1.com/docs/pic1.gif Note: if the URI <a href="libxml-SAX.html#reference">reference</a> is really wierd or complicated, it may be worthwhile to first convert it into a "nice" one by calling <a href="libxml-uri.html#xmlBuildURI">xmlBuildURI</a> (using 'base') before calling this routine, since this routine (for reasonable efficiency) assumes URI has already been through some validation.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI <a href="libxml-SAX.html#reference">reference</a> under consideration</td></tr><tr><td><span class="term"><i><tt>base</tt></i>:</span></td><td>the base value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new URI string (to be freed by the caller) or NULL in case error.</td></tr></tbody></table></div><h3><a name="xmlBuildURI" id="xmlBuildURI"></a>Function: xmlBuildURI</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlBuildURI (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * base)<br />
@@ -68,5 +69,5 @@ A:link, A:visited, A:active { text-decoration: underline }
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string of the URI to escape</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an copy of the string, but escaped 25 May 2001 Uses <a href="libxml-uri.html#xmlParseURI">xmlParseURI</a> and <a href="libxml-uri.html#xmlURIEscapeStr">xmlURIEscapeStr</a> to try to escape correctly according to RFC2396. - Carl Douglas</td></tr></tbody></table></div><h3><a name="xmlURIEscapeStr" id="xmlURIEscapeStr"></a>Function: xmlURIEscapeStr</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlURIEscapeStr (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * str, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * list)<br />
</pre><p>This routine escapes a string to hex, ignoring reserved <a href="libxml-SAX.html#characters">characters</a> (a-z) and the <a href="libxml-SAX.html#characters">characters</a> in the exception list.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>string to escape</td></tr><tr><td><span class="term"><i><tt>list</tt></i>:</span></td><td>exception list string of chars not to escape</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new escaped string or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlURIUnescapeString" id="xmlURIUnescapeString"></a>Function: xmlURIUnescapeString</h3><pre class="programlisting">char * xmlURIUnescapeString (const char * str, <br /> int len, <br /> char * target)<br />
-</pre><p>Unescaping routine, does not do validity checks ! Output is direct unsigned char translation of %XX values (no encoding)</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string to unescape</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the length in bytes to unescape (or &lt;= 0 to indicate full string)</td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td>optional destination buffer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an copy of the string, but unescaped</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+</pre><p>Unescaping routine, but does not check that the string is an URI. The output is a direct unsigned char translation of %XX values (no encoding) Note that the length of the result can only be smaller or same size as the input string.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string to unescape</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the length in bytes to unescape (or &lt;= 0 to indicate full string)</td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td>optional destination buffer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a copy of the string, but unescaped, will return NULL only in case of error</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index a7a8d56..4e031bc 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -1371,10 +1371,11 @@
<exports symbol='xmlRMutexUnlock' type='function'/>
<exports symbol='xmlGetGlobalState' type='function'/>
<exports symbol='xmlNewMutex' type='function'/>
- <exports symbol='xmlRMutexLock' type='function'/>
- <exports symbol='xmlInitThreads' type='function'/>
- <exports symbol='xmlUnlockLibrary' type='function'/>
+ <exports symbol='xmlDllMain' type='function'/>
<exports symbol='xmlFreeMutex' type='function'/>
+ <exports symbol='xmlUnlockLibrary' type='function'/>
+ <exports symbol='xmlInitThreads' type='function'/>
+ <exports symbol='xmlRMutexLock' type='function'/>
</file>
<file name='tree'>
<summary>interfaces for tree manipulation</summary>
@@ -6643,9 +6644,10 @@ Could we use @subtypes for this?'/>
<field name='user' type='char *' info=' the user part'/>
<field name='port' type='int' info=' the port number'/>
<field name='path' type='char *' info=' the path string'/>
- <field name='query' type='char *' info=' the query string'/>
+ <field name='query' type='char *' info=' the query string (deprecated - use with caution)'/>
<field name='fragment' type='char *' info=' the fragment identifier'/>
<field name='cleanup' type='int' info=' parsing potentially unclean URI'/>
+ <field name='query_raw' type='char *' info=' the query string (as it appears in the URI)'/>
</struct>
<typedef name='xmlURIPtr' file='uri' type='xmlURI *'/>
<struct name='xmlValidCtxt' file='valid' type='struct _xmlValidCtxt'>
@@ -9299,6 +9301,13 @@ Could we use @subtypes for this?'/>
<return type='int' info='the number of elements in the dictionnary or -1 in case of error'/>
<arg name='dict' type='xmlDictPtr' info='the dictionnary'/>
</function>
+ <function name='xmlDllMain' file='threads' module='threads'>
+ <info></info>
+ <return type='int' info=''/>
+ <arg name='hinstDLL' type='void *' info=''/>
+ <arg name='fdwReason' type='unsigned long' info=''/>
+ <arg name='lpvReserved' type='void *' info=''/>
+ </function>
<function name='xmlDocCopyNode' file='tree' module='tree'>
<info>Do a copy of the node to a given document.</info>
<return type='xmlNodePtr' info='a new #xmlNodePtr, or NULL in case of error.'/>
@@ -16511,8 +16520,8 @@ Could we use @subtypes for this?'/>
<arg name='list' type='const xmlChar *' info='exception list string of chars not to escape'/>
</function>
<function name='xmlURIUnescapeString' file='uri' module='uri'>
- <info>Unescaping routine, does not do validity checks ! Output is direct unsigned char translation of %XX values (no encoding)</info>
- <return type='char *' info='an copy of the string, but unescaped'/>
+ <info>Unescaping routine, but does not check that the string is an URI. The output is a direct unsigned char translation of %XX values (no encoding) Note that the length of the result can only be smaller or same size as the input string.</info>
+ <return type='char *' info='a copy of the string, but unescaped, will return NULL only in case of error'/>
<arg name='str' type='const char *' info='the string to unescape'/>
<arg name='len' type='int' info='the length in bytes to unescape (or &lt;= 0 to indicate full string)'/>
<arg name='target' type='char *' info='optional destination buffer'/>
diff --git a/doc/libxml2.xsa b/doc/libxml2.xsa
index 45afec6..81db327 100644
--- a/doc/libxml2.xsa
+++ b/doc/libxml2.xsa
@@ -8,59 +8,32 @@
</vendor>
<product id="libxml2">
<name>libxml2</name>
- <version>2.6.27</version>
- <last-release> Oct 25 2006</last-release>
+ <version>2.6.28</version>
+ <last-release> Apr 17 2007</last-release>
<info-url>http://xmlsoft.org/</info-url>
- <changes> - Portability fixes: file names on windows (Roland Schwingel,
- Emelyanov Alexey), windows compile fixup (Rob Richards),
- AIX iconv() is apparently case sensitive
- - improvements: Python XPath types mapping (Nic Ferrier), XPath optimization
- (Kasimier), add xmlXPathCompiledEvalToBoolean (Kasimier), Python node
- equality and comparison (Andreas Pakulat), xmlXPathCollectAndTest
- improvememt (Kasimier), expose if library was compiled with zlib
- support (Andrew Nosenko), cache for xmlSchemaIDCMatcher structs
- (Kasimier), xmlTextConcat should work with comments and PIs (Rob
- Richards), export htmlNewParserCtxt needed by Michael Day, refactoring
- of catalog entity loaders (Michael Day), add XPointer support to
- python bindings (Ross Reedstrom, Brian West and Stefan Anca),
- try to sort out most file path to URI conversions and xmlPathToUri,
- add --html --memory case to xmllint
- - building fix: fix --with-minimum (Felipe Contreras), VMS fix,
- const'ification of HTML parser structures (Matthias Clasen),
- portability fix (Emelyanov Alexey), wget autodetection (Peter
- Breitenlohner), remove the build path recorded in the python
- shared module, separate library flags for shared and static builds
- (Mikhail Zabaluev), fix --with-minimum --with-sax1 builds, fix
- --with-minimum --with-schemas builds
- - bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and
- attribute (Kasimier), crash when using the recover mode,
- xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier),
- missing destry in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
- (Kasimier), warning on entities processing, XHTML script and style
- serialization (Kasimier), python generator for long types, bug in
- xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate
- allocation bug (Marton Illes), error message end of line (Rob Richards),
- fix attribute serialization in writer (Rob Richards), PHP4 DTD validation
- crasher, parser safety patch (Ben Darnell), _private context propagation
- when parsing entities (with Michael Day), fix entities behaviour when
- using SAX, URI to file path fix (Mikhail Zabaluev), disapearing validity
- context, arg error in SAX callback (Mike Hommey), fix mixed-content
- autodetect when using --noblanks, fix xmlIOParseDTD error handling,
- fix bug in xmlSplitQName on special Names, fix Relax-NG element content
- validation bug, fix xmlReconciliateNs bug, fix potential attribute
- XML parsing bug, fix line/column accounting in XML parser, chunking bug
- in the HTML parser on script, try to detect obviously buggy HTML
- meta encoding indications, bugs with encoding BOM and xmlSaveDoc,
- HTML entities in attributes parsing, HTML minimized attribute values,
- htmlReadDoc and htmlReadIO were broken, error handling bug in
- xmlXPathEvalExpression (Olaf Walkowiak), fix a problem in
- htmlCtxtUseOptions, xmlNewInputFromFile could leak (Marius Konitzer),
- bug on misformed SSD regexps (Christopher Boumenot)
-
- - documentation: warning about XML_PARSE_COMPACT (Kasimier Buchcik),
- fix xmlXPathCastToString documentation, improve man pages for
- xmllitn and xmlcatalog (Daniel Leidert), fixed comments of a few
- functions
+ <changes> - Documentation: comment fixes (Markus Keim), xpath comments fixes too
+ (James Dennett)
+ - Bug fixes: XPath bug (William Brack), HTML parser autoclose stack usage
+ (Usamah Malik), various regexp bug fixes (DV and William), path conversion
+ on Windows (Igor Zlatkovic), htmlCtxtReset fix (Michael Day), XPath
+ principal node of axis bug, HTML serialization of some codepoint
+ (Steven Rainwater), user data propagation in XInclude (Michael Day),
+ standalone and XML decl detection (Michael Day), Python id ouptut
+ for some id, fix the big python string memory leak, URI parsing fixes
+ (Stéphane Bidoul and William), long comments parsing bug (William),
+ concurrent threads initialization (Ted Phelps), invalid char
+ in text XInclude (William), XPath memory leak (William), tab in
+ python problems (Andreas Hanke), XPath node comparison error
+ (Oleg Paraschenko), cleanup patch for reader (Julien Reichel),
+ XML Schemas attribute group (William), HTML parsing problem (William),
+ fix char 0x2d in regexps (William), regexp quantifier range with
+ min occurs of 0 (William), HTML script/style parsing (Mike Day)
+ - Improvement: make xmlTextReaderSetup() public
+ - Compilation and postability: fix a missing include problem (William),
+ __ss_familly on AIX again (Björn Wiberg), compilation without zlib
+ (Michael Day), catalog patch for Win32 (Christian Ehrlicher),
+ Windows CE fixes (Andreas Stricke)
+ - Various CVS to SVN infrastructure changes
</changes>
</product>
diff --git a/doc/news.html b/doc/news.html
index e05ab39..fae5b5a 100644
--- a/doc/news.html
+++ b/doc/news.html
@@ -12,7 +12,30 @@ to help those</p><ul><li>More testing on RelaxNG</li>
<li>Finishing up <a href="http://www.w3.org/TR/xmlschema-1/">XML
Schemas</a></li>
</ul><p>The <a href="ChangeLog.html">change log</a> describes the recents commits
-to the <a href="http://svn.gnome.org/viewcvs/libxml2/trunk/">SVN</a> code base.</p><p>Here is the list of public releases:</p><h3>2.6.28: Apr 17 2007</h3><ul><li>Documentation: comment fixes (Markus Keim), xpath comments fixes too
+to the <a href="http://svn.gnome.org/viewcvs/libxml2/trunk/">SVN</a> code base.</p><p>Here is the list of public releases:</p><h3>2.6.29: Jun 12 2007</h3><ul><li>Portability: patches from Andreas Stricke for WinCEi,
+ fix compilation warnings (William Brack), avoid warnings on Apple OS/X
+ (Wendy Doyle and Mark Rowe), Windows compilation and threading
+ improvements (Rob Richards), compilation against old Python versions,
+ new GNU tar changes (Ryan Hill)</li>
+ <li>Documentation: xmlURIUnescapeString comment, </li>
+ <li>Bugfixes: xmlBufferAdd problem (Richard Jones), 'make valgrind'
+ flag fix (Richard Jones), regexp interpretation of \,
+ htmlCreateDocParserCtxt (Jean-Daniel Dupas), configure.in
+ typo (Bjorn Reese), entity content failure, xmlListAppend() fix
+ (Georges-André Silber), XPath number serialization (William Brack),
+ nanohttp gzipped stream fix (William Brack and Alex Cornejo),
+ xmlCharEncFirstLine typo (Mark Rowe), uri bug (François Delyon),
+ XPath string value of PI nodes (William Brack), XPath node set
+ sorting bugs (William Brack), avoid outputting namespace decl
+ dups in the writer (Rob Richards), xmlCtxtReset bug, UTF-8 encoding
+ error handling, recustion on next in catalogs, fix a Relax-NG crash,
+ workaround wrong file: URIs, htmlNodeDumpFormatOutput on attributes,
+ invalid character in attribute detection bug, big comments before
+ internal subset streaming bug, HTML parsing of attributes with : in
+ the name, IDness of name in HTML (Dagfinn I. Mannsåker) </li>
+ <li>Improvement: keep URI query parts in raw form (Richard Jones),
+ embed tag support in HTML (Michael Day) </li>
+</ul><h3>2.6.28: Apr 17 2007</h3><ul><li>Documentation: comment fixes (Markus Keim), xpath comments fixes too
(James Dennett)</li>
<li>Bug fixes: XPath bug (William Brack), HTML parser autoclose stack usage
(Usamah Malik), various regexp bug fixes (DV and William), path conversion
diff --git a/doc/xml.html b/doc/xml.html
index 4b01691..6db27c7 100644
--- a/doc/xml.html
+++ b/doc/xml.html
@@ -739,6 +739,33 @@ to the <a href="http://svn.gnome.org/viewcvs/libxml2/trunk/">SVN</a> code base.<
<p>Here is the list of public releases:</p>
+<h3>2.6.29: Jun 12 2007</h3>
+<ul>
+ <li>Portability: patches from Andreas Stricke for WinCEi,
+ fix compilation warnings (William Brack), avoid warnings on Apple OS/X
+ (Wendy Doyle and Mark Rowe), Windows compilation and threading
+ improvements (Rob Richards), compilation against old Python versions,
+ new GNU tar changes (Ryan Hill)</li>
+ <li>Documentation: xmlURIUnescapeString comment, </li>
+ <li>Bugfixes: xmlBufferAdd problem (Richard Jones), 'make valgrind'
+ flag fix (Richard Jones), regexp interpretation of \,
+ htmlCreateDocParserCtxt (Jean-Daniel Dupas), configure.in
+ typo (Bjorn Reese), entity content failure, xmlListAppend() fix
+ (Georges-André Silber), XPath number serialization (William Brack),
+ nanohttp gzipped stream fix (William Brack and Alex Cornejo),
+ xmlCharEncFirstLine typo (Mark Rowe), uri bug (François Delyon),
+ XPath string value of PI nodes (William Brack), XPath node set
+ sorting bugs (William Brack), avoid outputting namespace decl
+ dups in the writer (Rob Richards), xmlCtxtReset bug, UTF-8 encoding
+ error handling, recustion on next in catalogs, fix a Relax-NG crash,
+ workaround wrong file: URIs, htmlNodeDumpFormatOutput on attributes,
+ invalid character in attribute detection bug, big comments before
+ internal subset streaming bug, HTML parsing of attributes with : in
+ the name, IDness of name in HTML (Dagfinn I. Mannsåker) </li>
+ <li>Improvement: keep URI query parts in raw form (Richard Jones),
+ embed tag support in HTML (Michael Day) </li>
+</ul>
+
<h3>2.6.28: Apr 17 2007</h3>
<ul>
<li>Documentation: comment fixes (Markus Keim), xpath comments fixes too
diff --git a/encoding.c b/encoding.c
index ee33df1..002eeba 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1761,19 +1761,20 @@ xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
if (out == NULL) return(-1);
if (in == NULL) return(-1);
+ /* calculate space available */
written = out->size - out->use;
toconv = in->use;
- if (toconv * 2 >= written) {
- xmlBufferGrow(out, toconv);
- written = out->size - out->use - 1;
- }
-
/*
* echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
* 45 chars should be sufficient to reach the end of the encoding
* declaration without going too far inside the document content.
*/
- written = 45;
+ if (toconv > 45)
+ toconv = 45;
+ if (toconv * 2 >= written) {
+ xmlBufferGrow(out, toconv);
+ written = out->size - out->use - 1;
+ }
if (handler->input != NULL) {
ret = handler->input(&out->content[out->use], &written,
diff --git a/include/libxml/threads.h b/include/libxml/threads.h
index 4f7d10f..f81f982 100644
--- a/include/libxml/threads.h
+++ b/include/libxml/threads.h
@@ -72,6 +72,10 @@ XMLPUBFUN void XMLCALL
XMLPUBFUN xmlGlobalStatePtr XMLCALL
xmlGetGlobalState(void);
+#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
+int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/include/libxml/uri.h b/include/libxml/uri.h
index 5e29671..49ed105 100644
--- a/include/libxml/uri.h
+++ b/include/libxml/uri.h
@@ -23,6 +23,10 @@ extern "C" {
*
* A parsed URI reference. This is a struct containing the various fields
* as described in RFC 2396 but separated for further processing.
+ *
+ * Note: query is a deprecated field which is incorrectly unescaped.
+ * query_raw takes precedence over query if the former is set.
+ * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127
*/
typedef struct _xmlURI xmlURI;
typedef xmlURI *xmlURIPtr;
@@ -34,9 +38,10 @@ struct _xmlURI {
char *user; /* the user part */
int port; /* the port number */
char *path; /* the path string */
- char *query; /* the query string */
+ char *query; /* the query string (deprecated - use with caution) */
char *fragment; /* the fragment identifier */
int cleanup; /* parsing potentially unclean URI */
+ char *query_raw; /* the query string (as it appears in the URI) */
};
/*
diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h
index 6eee895..78bad60 100644
--- a/include/libxml/xmlversion.h
+++ b/include/libxml/xmlversion.h
@@ -29,21 +29,21 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
-#define LIBXML_DOTTED_VERSION "2.6.28"
+#define LIBXML_DOTTED_VERSION "2.6.29"
/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
-#define LIBXML_VERSION 20628
+#define LIBXML_VERSION 20629
/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
-#define LIBXML_VERSION_STRING "20628"
+#define LIBXML_VERSION_STRING "20629"
/**
* LIBXML_VERSION_EXTRA:
@@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
-#define LIBXML_TEST_VERSION xmlCheckVersion(20628);
+#define LIBXML_TEST_VERSION xmlCheckVersion(20629);
#ifndef VMS
#if 0
@@ -91,7 +91,8 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Whether the thread support is configured in
*/
#if 1
-#if defined(_REENTRANT) || defined(__MT__) || (_POSIX_C_SOURCE - 0 >= 199506L)
+#if defined(_REENTRANT) || defined(__MT__) || \
+ (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L))
#define LIBXML_THREAD_ENABLED
#endif
#endif
diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in
index 0967913..29cef74 100644
--- a/include/libxml/xmlversion.h.in
+++ b/include/libxml/xmlversion.h.in
@@ -91,7 +91,8 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Whether the thread support is configured in
*/
#if @WITH_THREADS@
-#if defined(_REENTRANT) || defined(__MT__) || (_POSIX_C_SOURCE - 0 >= 199506L)
+#if defined(_REENTRANT) || defined(__MT__) || \
+ (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L))
#define LIBXML_THREAD_ENABLED
#endif
#endif
diff --git a/include/win32config.h b/include/win32config.h
index c61dfa9..6e9b33b 100644
--- a/include/win32config.h
+++ b/include/win32config.h
@@ -6,7 +6,7 @@
#define HAVE_MALLOC_H
#define HAVE_ERRNO_H
-#ifdef _WIN32_WCE
+#if defined(_WIN32_WCE)
#undef HAVE_ERRNO_H
#include <windows.h>
#include "wincecompat.h"
@@ -27,6 +27,11 @@
#include <wsockcompat.h>
#endif
+/*
+ * Windows platforms may define except
+ */
+#undef except
+
#define HAVE_ISINF
#define HAVE_ISNAN
#include <math.h>
@@ -95,7 +100,7 @@ static int isnan (double d) {
/* Threading API to use should be specified here for compatibility reasons.
This is however best specified on the compiler's command-line. */
#if defined(LIBXML_THREAD_ENABLED)
-#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS)
+#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE)
#define HAVE_WIN32_THREADS
#endif
#endif
diff --git a/libxml.h b/libxml.h
index 478d3e3..f5c6394 100644
--- a/libxml.h
+++ b/libxml.h
@@ -20,6 +20,14 @@
#if defined(macintosh)
#include "config-mac.h"
+#elif defined(_WIN32_WCE)
+/*
+ * Windows CE compatibility definitions and functions
+ * This is needed to compile libxml2 for Windows CE.
+ * At least I tested it with WinCE 5.0 for Emulator and WinCE 4.2/SH4 target
+ */
+#include <win32config.h>
+#include <libxml/xmlversion.h>
#else
#include "config.h"
#include <libxml/xmlversion.h>
@@ -32,15 +40,6 @@ int snprintf(char *, size_t, const char *, ...);
int vfprintf(FILE *, const char *, va_list);
#endif
-/*
- * Windows CE compatibility definitions and functions
- * This is needed to compile libxml2 for Windows CE.
- * At least I tested it with WinCE 4.2 for Emulator and SH4 target
- */
-#if defined(_WIN32_WCE)
-#include <wincecompat.h>
-#endif
-
#ifndef WITH_TRIO
#include <stdio.h>
#else
diff --git a/libxml2.spec b/libxml2.spec
index 675eda1..da2e0e7 100644
--- a/libxml2.spec
+++ b/libxml2.spec
@@ -1,6 +1,6 @@
Summary: Library providing XML and HTML support
Name: libxml2
-Version: 2.6.28
+Version: 2.6.29
Release: 1
License: MIT
Group: Development/Libraries
@@ -128,6 +128,6 @@ rm -fr %{buildroot}
%doc doc/python.html
%changelog
-* Tue Apr 17 2007 Daniel Veillard <veillard@redhat.com>
-- upstream release 2.6.28 see http://xmlsoft.org/news.html
+* Tue Jun 12 2007 Daniel Veillard <veillard@redhat.com>
+- upstream release 2.6.29 see http://xmlsoft.org/news.html
diff --git a/list.c b/list.c
index 2dc6d96..5c01c83 100644
--- a/list.c
+++ b/list.c
@@ -314,14 +314,14 @@ int xmlListAppend(xmlListPtr l, void *data)
if (lkNew == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Cannot initialize memory for new link");
- return (0);
+ return (1);
}
lkNew->data = data;
lkNew->next = lkPlace->next;
(lkPlace->next)->prev = lkNew;
lkPlace->next = lkNew;
lkNew->prev = lkPlace;
- return 1;
+ return 0;
}
/**
diff --git a/nanohttp.c b/nanohttp.c
index 26b5d7e..2406e7e 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -1203,16 +1203,19 @@ xmlNanoHTTPRead(void *ctx, void *dest, int len) {
ctxt->strm->next_out = dest;
ctxt->strm->avail_out = len;
+ ctxt->strm->avail_in = ctxt->inptr - ctxt->inrptr;
- do {
- orig_avail_in = ctxt->strm->avail_in = ctxt->inptr - ctxt->inrptr - bytes_read;
+ while (ctxt->strm->avail_out > 0 &&
+ (ctxt->strm->avail_in > 0 || xmlNanoHTTPRecv(ctxt) > 0)) {
+ orig_avail_in = ctxt->strm->avail_in =
+ ctxt->inptr - ctxt->inrptr - bytes_read;
ctxt->strm->next_in = BAD_CAST (ctxt->inrptr + bytes_read);
z_ret = inflate(ctxt->strm, Z_NO_FLUSH);
bytes_read += orig_avail_in - ctxt->strm->avail_in;
if (z_ret != Z_OK) break;
- } while (ctxt->strm->avail_out > 0 && xmlNanoHTTPRecv(ctxt) > 0);
+ }
ctxt->inrptr += bytes_read;
return(len - ctxt->strm->avail_out);
diff --git a/parser.c b/parser.c
index b405164..6cc8277 100644
--- a/parser.c
+++ b/parser.c
@@ -3074,7 +3074,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
*/
c = CUR_CHAR(l);
while ((NXT(0) != limit) && /* checked */
- (c != '<')) {
+ (IS_CHAR(c)) && (c != '<')) {
if (c == 0) break;
if (c == '&') {
in_space = 0;
@@ -3208,8 +3208,13 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
if (RAW == '<') {
xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
} else if (RAW != limit) {
- xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
- "AttValue: ' expected\n");
+ if ((c != 0) && (!IS_CHAR(c))) {
+ xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
+ "invalid character in attribute value\n");
+ } else {
+ xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
+ "AttValue: ' expected\n");
+ }
} else
NEXT;
if (attlen != NULL) *attlen = len;
@@ -6097,7 +6102,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
}
} else if ((ret != XML_ERR_OK) &&
(ret != XML_WAR_UNDECLARED_ENTITY)) {
- xmlFatalErr(ctxt, ret, NULL);
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
+ "Entity '%s' failed to parse\n", ent->name);
} else if (list != NULL) {
xmlFreeNodeList(list);
list = NULL;
@@ -10135,6 +10141,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
"PP: Parsing PI\n");
#endif
xmlParsePI(ctxt);
+ ctxt->checkIndex = 0;
} else if ((cur == '<') && (next == '!') &&
(ctxt->input->cur[2] == '-') &&
(ctxt->input->cur[3] == '-')) {
@@ -10147,6 +10154,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
#endif
xmlParseComment(ctxt);
ctxt->instate = XML_PARSER_MISC;
+ ctxt->checkIndex = 0;
} else if ((cur == '<') && (next == '!') &&
(ctxt->input->cur[2] == 'D') &&
(ctxt->input->cur[3] == 'O') &&
@@ -12953,8 +12961,12 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt)
ctxt->input = NULL;
ctxt->spaceNr = 0;
- ctxt->spaceTab[0] = -1;
- ctxt->space = &ctxt->spaceTab[0];
+ if (ctxt->spaceTab != NULL) {
+ ctxt->spaceTab[0] = -1;
+ ctxt->space = &ctxt->spaceTab[0];
+ } else {
+ ctxt->space = NULL;
+ }
ctxt->nodeNr = 0;
diff --git a/python/libxml2-py.c b/python/libxml2-py.c
index c979a3a..0874a60 100644
--- a/python/libxml2-py.c
+++ b/python/libxml2-py.c
@@ -978,6 +978,22 @@ libxml_xmlParseMarkupDecl(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
PyObject *
+libxml_xmlURISetQueryRaw(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ xmlURIPtr URI;
+ PyObject *pyobj_URI;
+ char * query_raw;
+
+ if (!PyArg_ParseTuple(args, (char *)"Oz:xmlURISetQueryRaw", &pyobj_URI, &query_raw))
+ return(NULL);
+ URI = (xmlURIPtr) PyURI_Get(pyobj_URI);
+
+ if (URI->query_raw != NULL) xmlFree(URI->query_raw);
+ URI->query_raw = (char *)xmlStrdup((const xmlChar *)query_raw);
+ Py_INCREF(Py_None);
+ return(Py_None);
+}
+
+PyObject *
libxml_xmlHasNsProp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *py_retval;
xmlAttrPtr c_retval;
@@ -14054,6 +14070,22 @@ libxml_xmlUCSIsOldItalic(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
}
#endif /* defined(LIBXML_UNICODE_ENABLED) */
+PyObject *
+libxml_xmlURIGetQueryRaw(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
+ PyObject *py_retval;
+ const char * c_retval;
+ xmlURIPtr URI;
+ PyObject *pyobj_URI;
+
+ if (!PyArg_ParseTuple(args, (char *)"O:xmlURIGetQueryRaw", &pyobj_URI))
+ return(NULL);
+ URI = (xmlURIPtr) PyURI_Get(pyobj_URI);
+
+ c_retval = URI->query_raw;
+ py_retval = libxml_charPtrConstWrap((const char *) c_retval);
+ return(py_retval);
+}
+
#if defined(LIBXML_XPATH_ENABLED)
PyObject *
libxml_xmlXPathPopNumber(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
diff --git a/python/libxml2-python-api.xml b/python/libxml2-python-api.xml
index f77a237..42f661d 100644
--- a/python/libxml2-python-api.xml
+++ b/python/libxml2-python-api.xml
@@ -265,6 +265,17 @@
<arg name='URI' type='xmlURIPtr' info='the URI'/>
<arg name='query' type='char *' info='The URI query part'/>
</function>
+ <function name='xmlURIGetQueryRaw' file='python_accessor'>
+ <info>Get the raw query part from an URI (i.e. the unescaped form).</info>
+ <return type='const char *' info="The URI query" field="query_raw"/>
+ <arg name='URI' type='xmlURIPtr' info='the URI'/>
+ </function>
+ <function name='xmlURISetQueryRaw' file='python_accessor'>
+ <info>Set the raw query part of an URI (i.e. the unescaped form).</info>
+ <return type='void'/>
+ <arg name='URI' type='xmlURIPtr' info='the URI'/>
+ <arg name='query_raw' type='char *' info='The raw URI query part'/>
+ </function>
<function name='xmlURIGetFragment' file='python_accessor'>
<info>Get the fragment part from an URI</info>
<return type='const char *' info="The URI fragment" field="fragment"/>
diff --git a/python/setup.py b/python/setup.py
index 5eab8dc..191c03d 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -226,7 +226,7 @@ else:
setup (name = "libxml2-python",
# On *nix, the version number is created from setup.py.in
# On windows, it is set by configure.js
- version = "2.6.28",
+ version = "2.6.29",
description = descr,
author = "Daniel Veillard",
author_email = "veillard@redhat.com",
diff --git a/python/types.c b/python/types.c
index 5c5dcca..9a17749 100644
--- a/python/types.c
+++ b/python/types.c
@@ -525,6 +525,7 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj)
ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
+#ifdef PyBool_Check
} else if PyBool_Check (obj) {
if (obj == Py_True) {
@@ -533,7 +534,7 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj)
else {
ret = xmlXPathNewBoolean(0);
}
-
+#endif
} else if PyString_Check
(obj) {
xmlChar *str;
diff --git a/relaxng.c b/relaxng.c
index 16527cc..60fdbab 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -9828,7 +9828,8 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt,
ret = -1;
} else {
state = ctxt->state;
- ctxt->state->seq = nseq;
+ if (ctxt->state != NULL)
+ ctxt->state->seq = nseq;
if (ret == 0)
ret = xmlRelaxNGValidateElementEnd(ctxt, 1);
xmlRelaxNGFreeValidState(ctxt, state);
diff --git a/schematron.c b/schematron.c
index 0a90ff8..a2eabcc 100644
--- a/schematron.c
+++ b/schematron.c
@@ -714,6 +714,7 @@ xmlSchematronFreeParserCtxt(xmlSchematronParserCtxtPtr ctxt)
xmlFree(ctxt);
}
+#if 0
/**
* xmlSchematronPushInclude:
* @ctxt: the schema parser context
@@ -782,6 +783,7 @@ xmlSchematronPopInclude(xmlSchematronParserCtxtPtr ctxt)
return(xmlSchematronPopInclude(ctxt));
return(ret);
}
+#endif
/**
* xmlSchematronAddNamespace:
@@ -987,6 +989,7 @@ xmlSchematronParsePattern(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr pat)
}
}
+#if 0
/**
* xmlSchematronLoadInclude:
* @ctxt: a schema validation context
@@ -1051,6 +1054,7 @@ done:
xmlFree(URI);
return(ret);
}
+#endif
/**
* xmlSchematronParse:
diff --git a/testapi.c b/testapi.c
index 969fdd3..af71ac2 100644
--- a/testapi.c
+++ b/testapi.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv) {
int blocks, mem;
/* access to the proxy can slow up regression tests a lot */
- putenv("http_proxy=");
+ putenv((char *) "http_proxy=");
memset(chartab, 0, sizeof(chartab));
strncpy((char *) chartab, " chartab\n", 20);
diff --git a/threads.c b/threads.c
index 87d0d36..0ab9e77 100644
--- a/threads.c
+++ b/threads.c
@@ -441,7 +441,11 @@ __xmlGlobalInitMutexLock(void)
InitializeCriticalSection(cs);
/* Swap it into the global_init_lock */
+#ifdef InterlockedCompareExchangePointer
InterlockedCompareExchangePointer(&global_init_lock, cs, NULL);
+#else /* Use older void* version */
+ InterlockedCompareExchange((void **)&global_init_lock, (void *)cs, NULL);
+#endif /* InterlockedCompareExchangePointer */
/* If another thread successfully recorded its critical
* section in the global_init_lock then discard the one
@@ -912,7 +916,7 @@ xmlOnceInit(void) {
*/
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
#if defined(LIBXML_STATIC_FOR_DLL)
-BOOL WINAPI xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL XMLCALL xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
#else
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
#endif
diff --git a/tree.c b/tree.c
index ffbcabd..432007e 100644
--- a/tree.c
+++ b/tree.c
@@ -4848,7 +4848,7 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) {
fixed = xmlPathToURI(uri);
if (fixed != NULL) {
xmlSetNsProp(cur, ns, BAD_CAST "base", fixed);
- xmlFree(fixed);
+ xmlFree((xmlChar *)fixed);
} else {
xmlSetNsProp(cur, ns, BAD_CAST "base", uri);
}
@@ -6968,7 +6968,8 @@ xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
if (len < 0)
len = xmlStrlen(str);
- if (len <= 0) return -1;
+ if (len < 0) return -1;
+ if (len == 0) return 0;
needSize = buf->use + len + 2;
if (needSize > buf->size){
diff --git a/uri.c b/uri.c
index 35cf98a..4f5e182 100644
--- a/uri.c
+++ b/uri.c
@@ -446,7 +446,33 @@ xmlSaveUri(xmlURIPtr uri) {
}
}
}
- if (uri->query != NULL) {
+ if (uri->query_raw != NULL) {
+ if (len + 1 >= max) {
+ max *= 2;
+ ret = (xmlChar *) xmlRealloc(ret,
+ (max + 1) * sizeof(xmlChar));
+ if (ret == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ return(NULL);
+ }
+ }
+ ret[len++] = '?';
+ p = uri->query_raw;
+ while (*p != 0) {
+ if (len + 1 >= max) {
+ max *= 2;
+ ret = (xmlChar *) xmlRealloc(ret,
+ (max + 1) * sizeof(xmlChar));
+ if (ret == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ return(NULL);
+ }
+ }
+ ret[len++] = *p++;
+ }
+ } else if (uri->query != NULL) {
if (len + 3 >= max) {
max *= 2;
ret = (xmlChar *) xmlRealloc(ret,
@@ -574,6 +600,8 @@ xmlCleanURI(xmlURIPtr uri) {
uri->authority = NULL;
if (uri->query != NULL) xmlFree(uri->query);
uri->query = NULL;
+ if (uri->query_raw != NULL) xmlFree(uri->query_raw);
+ uri->query_raw = NULL;
}
/**
@@ -594,6 +622,7 @@ xmlFreeURI(xmlURIPtr uri) {
if (uri->opaque != NULL) xmlFree(uri->opaque);
if (uri->authority != NULL) xmlFree(uri->authority);
if (uri->query != NULL) xmlFree(uri->query);
+ if (uri->query_raw != NULL) xmlFree(uri->query_raw);
xmlFree(uri);
}
@@ -805,10 +834,13 @@ static int is_hex(char c) {
* @len: the length in bytes to unescape (or <= 0 to indicate full string)
* @target: optional destination buffer
*
- * Unescaping routine, does not do validity checks !
- * Output is direct unsigned char translation of %XX values (no encoding)
+ * Unescaping routine, but does not check that the string is an URI. The
+ * output is a direct unsigned char translation of %XX values (no encoding)
+ * Note that the length of the result can only be smaller or same size as
+ * the input string.
*
- * Returns an copy of the string, but unescaped
+ * Returns a copy of the string, but unescaped, will return NULL only in case
+ * of error
*/
char *
xmlURIUnescapeString(const char *str, int len, char *target) {
@@ -1027,7 +1059,11 @@ xmlURIEscape(const xmlChar * str)
xmlFree(segment);
}
- if (uri->query) {
+ if (uri->query_raw) {
+ ret = xmlStrcat(ret, BAD_CAST "?");
+ ret = xmlStrcat(ret, BAD_CAST uri->query_raw);
+ }
+ else if (uri->query) {
segment =
xmlURIEscapeStr(BAD_CAST uri->query, BAD_CAST ";/?:@&=+,$");
NULLCHK(segment)
@@ -1130,6 +1166,13 @@ xmlParseURIQuery(xmlURIPtr uri, const char **str)
uri->query = STRNDUP(*str, cur - *str);
else
uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
+
+ /* Save the raw bytes of the query as well.
+ * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00114
+ */
+ if (uri->query_raw != NULL)
+ xmlFree (uri->query_raw);
+ uri->query_raw = STRNDUP (*str, cur - *str);
}
*str = cur;
return (0);
@@ -1253,7 +1296,7 @@ xmlParseURIServer(xmlURIPtr uri, const char **str) {
if (uri != NULL) {
if (uri->user != NULL) xmlFree(uri->user);
if (uri->cleanup & 2)
- uri->path = STRNDUP(*str, cur - *str);
+ uri->user = STRNDUP(*str, cur - *str);
else
uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
}
@@ -1943,8 +1986,12 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) {
}
if (bas->path != NULL)
res->path = xmlMemStrdup(bas->path);
- if (ref->query != NULL)
+ if (ref->query_raw != NULL)
+ res->query_raw = xmlMemStrdup (ref->query_raw);
+ else if (ref->query != NULL)
res->query = xmlMemStrdup(ref->query);
+ else if (bas->query_raw != NULL)
+ res->query_raw = xmlMemStrdup(bas->query_raw);
else if (bas->query != NULL)
res->query = xmlMemStrdup(bas->query);
if (ref->fragment != NULL)
@@ -1965,7 +2012,9 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) {
if (bas->scheme != NULL)
res->scheme = xmlMemStrdup(bas->scheme);
- if (ref->query != NULL)
+ if (ref->query_raw != NULL)
+ res->query_raw = xmlMemStrdup(ref->query_raw);
+ else if (ref->query != NULL)
res->query = xmlMemStrdup(ref->query);
if (ref->fragment != NULL)
res->fragment = xmlMemStrdup(ref->fragment);
diff --git a/valid.c b/valid.c
index a239e68..2510b8d 100644
--- a/valid.c
+++ b/valid.c
@@ -2724,7 +2724,7 @@ xmlIsID(xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr) {
} else if (doc->type == XML_HTML_DOCUMENT_NODE) {
if ((xmlStrEqual(BAD_CAST "id", attr->name)) ||
((xmlStrEqual(BAD_CAST "name", attr->name)) &&
- ((elem == NULL) || (!xmlStrEqual(elem->name, BAD_CAST "input")))))
+ ((elem == NULL) || (xmlStrEqual(elem->name, BAD_CAST "a")))))
return(1);
return(0);
} else if (elem == NULL) {
@@ -2998,19 +2998,32 @@ xmlAddRef(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value,
xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR,
"xmlAddRef: Reference list creation failed!\n",
NULL);
- return(NULL);
+ goto failed;
}
if (xmlHashAddEntry(table, value, ref_list) < 0) {
xmlListDelete(ref_list);
xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR,
"xmlAddRef: Reference list insertion failed!\n",
NULL);
- return(NULL);
+ goto failed;
}
}
-/* xmlListInsert(ref_list, ret); */
- xmlListAppend(ref_list, ret);
+ if (xmlListAppend(ref_list, ret) != 0) {
+ xmlErrValid(NULL, XML_ERR_INTERNAL_ERROR,
+ "xmlAddRef: Reference list insertion failed!\n",
+ NULL);
+ goto failed;
+ }
return(ret);
+failed:
+ if (ret != NULL) {
+ if (ret->value != NULL)
+ xmlFree((char *)ret->value);
+ if (ret->name != NULL)
+ xmlFree((char *)ret->name);
+ xmlFree(ret);
+ }
+ return(NULL);
}
/**
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index 35f4a80..9046ff3 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -25,11 +25,13 @@ XML_SO = $(XML_BASENAME).dll
XML_IMP = $(XML_BASENAME).lib
XML_DEF = $(XML_BASENAME).def
XML_A = $(XML_BASENAME)_a.lib
+XML_A_DLL = $(XML_BASENAME)_a_dll.lib
# Place where we let the compiler put its output.
BINDIR = bin.msvc
XML_INTDIR = int.msvc
XML_INTDIR_A = int.a.msvc
+XML_INTDIR_A_DLL = int.a.dll.msvc
UTILS_INTDIR = int.utils.msvc
# The preprocessor and its options.
@@ -56,6 +58,7 @@ CFLAGS = $(CFLAGS) /D "HAVE_PTHREAD_H"
!if "$(WITH_ZLIB)" == "1"
CFLAGS = $(CFLAGS) /D "HAVE_ZLIB_H"
!endif
+CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
# The linker and its options.
LD = link.exe
@@ -181,6 +184,51 @@ XML_OBJS_A = $(XML_INTDIR_A)\c14n.obj\
$(XML_INTDIR_A)\xpointer.obj\
$(XML_INTDIR_A)\xmlstring.obj
+# Static libxml object files.
+XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\c14n.obj\
+ $(XML_INTDIR_A_DLL)\catalog.obj\
+ $(XML_INTDIR_A_DLL)\chvalid.obj\
+ $(XML_INTDIR_A_DLL)\debugXML.obj\
+ $(XML_INTDIR_A_DLL)\dict.obj\
+ $(XML_INTDIR_A_DLL)\DOCBparser.obj\
+ $(XML_INTDIR_A_DLL)\encoding.obj\
+ $(XML_INTDIR_A_DLL)\entities.obj\
+ $(XML_INTDIR_A_DLL)\error.obj\
+ $(XML_INTDIR_A_DLL)\globals.obj\
+ $(XML_INTDIR_A_DLL)\hash.obj\
+ $(XML_INTDIR_A_DLL)\HTMLparser.obj\
+ $(XML_INTDIR_A_DLL)\HTMLtree.obj\
+ $(XML_INTDIR_A_DLL)\legacy.obj\
+ $(XML_INTDIR_A_DLL)\list.obj\
+ $(XML_INTDIR_A_DLL)\nanoftp.obj\
+ $(XML_INTDIR_A_DLL)\nanohttp.obj\
+ $(XML_INTDIR_A_DLL)\parser.obj\
+ $(XML_INTDIR_A_DLL)\parserInternals.obj\
+ $(XML_INTDIR_A_DLL)\pattern.obj\
+ $(XML_INTDIR_A_DLL)\relaxng.obj\
+ $(XML_INTDIR_A_DLL)\SAX2.obj\
+ $(XML_INTDIR_A_DLL)\SAX.obj\
+ $(XML_INTDIR_A_DLL)\schematron.obj\
+ $(XML_INTDIR_A_DLL)\threads.obj\
+ $(XML_INTDIR_A_DLL)\tree.obj\
+ $(XML_INTDIR_A_DLL)\uri.obj\
+ $(XML_INTDIR_A_DLL)\valid.obj\
+ $(XML_INTDIR_A_DLL)\xinclude.obj\
+ $(XML_INTDIR_A_DLL)\xlink.obj\
+ $(XML_INTDIR_A_DLL)\xmlIO.obj\
+ $(XML_INTDIR_A_DLL)\xmlmemory.obj\
+ $(XML_INTDIR_A_DLL)\xmlreader.obj\
+ $(XML_INTDIR_A_DLL)\xmlregexp.obj\
+ $(XML_INTDIR_A_DLL)\xmlmodule.obj\
+ $(XML_INTDIR_A_DLL)\xmlsave.obj\
+ $(XML_INTDIR_A_DLL)\xmlschemas.obj\
+ $(XML_INTDIR_A_DLL)\xmlschemastypes.obj\
+ $(XML_INTDIR_A_DLL)\xmlunicode.obj\
+ $(XML_INTDIR_A_DLL)\xmlwriter.obj\
+ $(XML_INTDIR_A_DLL)\xpath.obj\
+ $(XML_INTDIR_A_DLL)\xpointer.obj\
+ $(XML_INTDIR_A_DLL)\xmlstring.obj
+
# Xmllint and friends executables.
UTILS = $(BINDIR)\xmllint.exe\
$(BINDIR)\xmlcatalog.exe\
@@ -206,17 +254,28 @@ UTILS = $(UTILS) $(BINDIR)\testThreadsWin32.exe
UTILS = $(UTILS) $(BINDIR)\testThreads.exe
!endif
-all : libxml libxmla utils
+!if "$(VCMANIFEST)" == "1"
+_VC_MANIFEST_EMBED_EXE= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
+_VC_MANIFEST_EMBED_DLL= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
+!else
+_VC_MANIFEST_EMBED_EXE=
+_VC_MANIFEST_EMBED_DLL=
+!endif
+
+all : libxml libxmla libxmladll utils
libxml : $(BINDIR)\$(XML_SO)
libxmla : $(BINDIR)\$(XML_A)
+libxmladll : $(BINDIR)\$(XML_A_DLL)
+
utils : $(UTILS)
clean :
if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)
if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)
+ if exist $(XML_INTDIR_A_DLL) rmdir /S /Q $(XML_INTDIR_A_DLL)
if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
if exist $(BINDIR) rmdir /S /Q $(BINDIR)
@@ -234,6 +293,7 @@ install-libs : all
copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml
copy $(BINDIR)\$(XML_SO) $(SOPREFIX)
copy $(BINDIR)\$(XML_A) $(LIBPREFIX)
+ copy $(BINDIR)\$(XML_A_DLL) $(LIBPREFIX)
copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)
install : install-libs
@@ -266,6 +326,10 @@ $(XML_INTDIR) :
$(XML_INTDIR_A) :
if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
+# Makes the static for dll libxml intermediate directory.
+$(XML_INTDIR_A_DLL) :
+ if not exist $(XML_INTDIR_A_DLL) mkdir $(XML_INTDIR_A_DLL)
+
# An implicit rule for libxml compilation.
{$(XML_SRCDIR)}.c{$(XML_INTDIR)}.obj::
$(CC) $(CFLAGS) /Fo$(XML_INTDIR)\ /c $<
@@ -274,12 +338,19 @@ $(XML_INTDIR_A) :
{$(XML_SRCDIR)}.c{$(XML_INTDIR_A)}.obj::
$(CC) $(CFLAGS) /D "LIBXML_STATIC" /Fo$(XML_INTDIR_A)\ /c $<
+# An implicit rule for static for dll libxml compilation.
+{$(XML_SRCDIR)}.c{$(XML_INTDIR_A_DLL)}.obj::
+ $(CC) $(CFLAGS) /D "LIBXML_STATIC" /D "LIBXML_STATIC_FOR_DLL" /Fo$(XML_INTDIR_A_DLL)\ /c $<
+
# Compiles libxml source. Uses the implicit rule for commands.
$(XML_OBJS) : $(XML_INTDIR)
# Compiles static libxml source. Uses the implicit rule for commands.
$(XML_OBJS_A) : $(XML_INTDIR_A)
+# Compiles static for dll libxml source. Uses the implicit rule for commands.
+$(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL)
+
# Creates the export definition file (DEF) for libxml.
$(XML_INTDIR)\$(XML_DEF) : $(XML_INTDIR) $(XML_DEF).src
$(CPP) $(CPPFLAGS) $(XML_DEF).src > $(XML_INTDIR)\$(XML_DEF)
@@ -288,6 +359,7 @@ $(XML_INTDIR)\$(XML_DEF) : $(XML_INTDIR) $(XML_DEF).src
$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
$(LD) $(LDFLAGS) /DLL \
/IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
+ @$(_VC_MANIFEST_EMBED_DLL)
#$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
# $(LD) $(LDFLAGS) /DLL /DEF:$(XML_INTDIR)\$(XML_DEF) \
@@ -297,6 +369,9 @@ $(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
$(BINDIR)\$(XML_A) : $(BINDIR) $(XML_OBJS_A)
$(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A) $(XML_OBJS_A)
+# Creates the libxml static for dll archive.
+$(BINDIR)\$(XML_A_DLL) : $(BINDIR) $(XML_OBJS_A_DLL)
+ $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A_DLL) $(XML_OBJS_A_DLL)
# Makes the utils intermediate directory.
$(UTILS_INTDIR) :
@@ -307,14 +382,16 @@ $(UTILS_INTDIR) :
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) /D "LIBXML_STATIC" $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
$(LD) $(LDFLAGS) /OUT:$@ $(XML_A) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
+ @$(_VC_MANIFEST_EMBED_EXE)
!else
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
$(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
+ @$(_VC_MANIFEST_EMBED_EXE)
!endif
# Builds xmllint and friends. Uses the implicit rule for commands.
-$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla
+$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla libxmladll
# Source dependences should be autogenerated somehow here, but how to
# do it? I have no clue.
diff --git a/win32/configure.js b/win32/configure.js
index 5d73f5a..a7cf837 100644
--- a/win32/configure.js
+++ b/win32/configure.js
@@ -65,6 +65,7 @@ var dirSep = "\\";
var compiler = "msvc";
var cruntime = "/MD";
var dynruntime = true;
+var vcmanifest = false;
var buildDebug = 0;
var buildStatic = 0;
var buildPrefix = ".";
@@ -147,6 +148,7 @@ function usage()
txt += " compiler: Compiler to be used [msvc|mingw|bcb] (" + compiler + ")\n";
txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n";
txt += " dynruntime: Use the dynamic RTL (only bcb) (" + dynruntime + ")\n";
+ txt += " vcmanifest: Embed VC manifest (only msvc) (" + (vcmanifest? "yes" : "no") + ")\n";
txt += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n";
txt += " static: Link xmllint statically to libxml2 (" + (buildStatic? "yes" : "no") + ")\n";
txt += " Note: automatically enabled if cruntime is not /MD or /MDd\n";
@@ -262,13 +264,14 @@ function discoverVersion()
vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude);
vf.WriteLine("LIB=$(LIB);" + buildLib);
vf.WriteLine("CRUNTIME=" + cruntime);
+ vf.WriteLine("VCMANIFEST=" + (vcmanifest? "1" : "0"));
} else if (compiler == "mingw") {
vf.WriteLine("INCLUDE+=;" + buildInclude);
vf.WriteLine("LIB+=;" + buildLib);
} else if (compiler == "bcb") {
vf.WriteLine("INCLUDE=" + buildInclude);
vf.WriteLine("LIB=" + buildLib);
- vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
+ vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
}
vf.Close();
}
@@ -505,6 +508,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
cruntime = arg.substring(opt.length + 1, arg.length);
else if (opt == "dynruntime")
dynruntime = strToBool(arg.substring(opt.length + 1, arg.length));
+ else if (opt == "vcmanifest")
+ vcmanifest = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "debug")
buildDebug = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "static")
@@ -661,9 +666,10 @@ txtOut += "\n";
txtOut += "Win32 build configuration\n";
txtOut += "-------------------------\n";
txtOut += " Compiler: " + compiler + "\n";
-if (compiler == "msvc")
+if (compiler == "msvc") {
txtOut += " C-Runtime option: " + cruntime + "\n";
-else if (compiler == "bcb")
+ txtOut += " Embed Manifest: " + boolToStr(vcmanifest) + "\n";
+} else if (compiler == "bcb")
txtOut += " Use dynamic RTL: " + dynruntime + "\n";
txtOut += " Debug symbols: " + boolToStr(buildDebug) + "\n";
txtOut += " Static xmllint: " + boolToStr(buildStatic) + "\n";
diff --git a/xmlIO.c b/xmlIO.c
index f576d76..685ce26 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -844,18 +844,25 @@ xmlFileOpen_real (const char *filename) {
return((void *) fd);
}
- if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17))
+ if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) {
#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__)
path = &filename[17];
#else
path = &filename[16];
#endif
- else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) {
+ } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) {
#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__)
path = &filename[8];
#else
path = &filename[7];
#endif
+ } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:/", 6)) {
+ /* lots of generators seems to lazy to read RFC 1738 */
+#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__)
+ path = &filename[6];
+#else
+ path = &filename[5];
+#endif
} else
path = filename;
@@ -3638,7 +3645,7 @@ static int xmlNoNetExists(const char *URL) {
*
* Returns a new allocated URL, or NULL.
*/
-xmlChar *
+static xmlChar *
xmlResolveResourceFromCatalog(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt) {
xmlChar *resource = NULL;
diff --git a/xmlregexp.c b/xmlregexp.c
index 2a30d66..e729d57 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -4751,6 +4751,8 @@ xmlFAParseCharClassEsc(xmlRegParserCtxtPtr ctxt) {
xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
type, 0, 0, NULL);
}
+ } else {
+ ERROR("Wrong escape sequence, misuse of character '\\'");
}
}
@@ -5307,6 +5309,10 @@ xmlRegexpCompile(const xmlChar *regexp) {
if (CUR != 0) {
ERROR("xmlFAParseRegExp: extra characters");
}
+ if (ctxt->error != 0) {
+ xmlRegFreeParserCtxt(ctxt);
+ return(NULL);
+ }
ctxt->end = ctxt->state;
ctxt->start->type = XML_REGEXP_START_STATE;
ctxt->end->type = XML_REGEXP_FINAL_STATE;
diff --git a/xmlsave.c b/xmlsave.c
index 231ee7b..b97327e 100644
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -834,7 +834,6 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) {
xmlCharEncodingOutputFunc oldescape = ctxt->escape;
xmlCharEncodingOutputFunc oldescapeAttr = ctxt->escapeAttr;
xmlOutputBufferPtr buf = ctxt->buf;
- xmlCharEncodingHandlerPtr handler = NULL;
xmlCharEncoding enc;
xmlInitParser();
diff --git a/xmlwriter.c b/xmlwriter.c
index 2e67a4f..f618610 100644
--- a/xmlwriter.c
+++ b/xmlwriter.c
@@ -97,6 +97,7 @@ struct _xmlTextWriter {
static void xmlFreeTextWriterStackEntry(xmlLinkPtr lk);
static int xmlCmpTextWriterStackEntry(const void *data0,
const void *data1);
+static int xmlTextWriterOutputNSDecl(xmlTextWriterPtr writer);
static void xmlFreeTextWriterNsStackEntry(xmlLinkPtr lk);
static int xmlCmpTextWriterNsStackEntry(const void *data0,
const void *data1);
@@ -734,6 +735,11 @@ xmlTextWriterStartComment(xmlTextWriterPtr writer)
case XML_TEXTWRITER_NONE:
break;
case XML_TEXTWRITER_NAME:
+ /* Output namespace declarations */
+ count = xmlTextWriterOutputNSDecl(writer);
+ if (count < 0)
+ return -1;
+ sum += count;
count = xmlOutputBufferWriteString(writer->out, ">");
if (count < 0)
return -1;
@@ -965,6 +971,11 @@ xmlTextWriterStartElement(xmlTextWriterPtr writer, const xmlChar * name)
sum += count;
/* fallthrough */
case XML_TEXTWRITER_NAME:
+ /* Output namespace declarations */
+ count = xmlTextWriterOutputNSDecl(writer);
+ if (count < 0)
+ return -1;
+ sum += count;
count = xmlOutputBufferWriteString(writer->out, ">");
if (count < 0)
return -1;
@@ -1055,17 +1066,31 @@ xmlTextWriterStartElementNS(xmlTextWriterPtr writer,
sum += count;
if (namespaceURI != 0) {
+ xmlTextWriterNsStackEntry *p = (xmlTextWriterNsStackEntry *)
+ xmlMalloc(sizeof(xmlTextWriterNsStackEntry));
+ if (p == 0) {
+ xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY,
+ "xmlTextWriterStartElementNS : out of memory!\n");
+ return -1;
+ }
+
buf = xmlStrdup(BAD_CAST "xmlns");
if (prefix != 0) {
buf = xmlStrcat(buf, BAD_CAST ":");
buf = xmlStrcat(buf, prefix);
}
- count = xmlTextWriterWriteAttribute(writer, buf, namespaceURI);
- xmlFree(buf);
- if (count < 0)
+ p->prefix = buf;
+ p->uri = xmlStrdup(namespaceURI);
+ if (p->uri == 0) {
+ xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY,
+ "xmlTextWriterStartElementNS : out of memory!\n");
+ xmlFree(p);
return -1;
- sum += count;
+ }
+ p->elem = xmlListFront(writer->nodes);
+
+ xmlListPushFront(writer->nsstack, p);
}
return sum;
@@ -1091,22 +1116,37 @@ xmlTextWriterEndElement(xmlTextWriterPtr writer)
return -1;
lk = xmlListFront(writer->nodes);
- if (lk == 0)
+ if (lk == 0) {
+ xmlListDelete(writer->nsstack);
+ writer->nsstack = NULL;
return -1;
+ }
p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk);
- if (p == 0)
+ if (p == 0) {
+ xmlListDelete(writer->nsstack);
+ writer->nsstack = NULL;
return -1;
+ }
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_ATTRIBUTE:
count = xmlTextWriterEndAttribute(writer);
- if (count < 0)
+ if (count < 0) {
+ xmlListDelete(writer->nsstack);
+ writer->nsstack = NULL;
return -1;
+ }
sum += count;
/* fallthrough */
case XML_TEXTWRITER_NAME:
+ /* Output namespace declarations */
+ count = xmlTextWriterOutputNSDecl(writer);
+ if (count < 0)
+ return -1;
+ sum += count;
+
if (writer->indent) /* next element needs indent */
writer->doindent = 1;
count = xmlOutputBufferWriteString(writer->out, "/>");
@@ -1184,6 +1224,12 @@ xmlTextWriterFullEndElement(xmlTextWriterPtr writer)
sum += count;
/* fallthrough */
case XML_TEXTWRITER_NAME:
+ /* Output namespace declarations */
+ count = xmlTextWriterOutputNSDecl(writer);
+ if (count < 0)
+ return -1;
+ sum += count;
+
count = xmlOutputBufferWriteString(writer->out, ">");
if (count < 0)
return -1;
@@ -1767,6 +1813,57 @@ xmlTextWriterStartAttributeNS(xmlTextWriterPtr writer,
if ((writer == NULL) || (name == NULL) || (*name == '\0'))
return -1;
+ /* Handle namespace first in case of error */
+ if (namespaceURI != 0) {
+ xmlTextWriterNsStackEntry nsentry, *curns;
+
+ buf = xmlStrdup(BAD_CAST "xmlns");
+ if (prefix != 0) {
+ buf = xmlStrcat(buf, BAD_CAST ":");
+ buf = xmlStrcat(buf, prefix);
+ }
+
+ nsentry.prefix = buf;
+ nsentry.uri = (xmlChar *)namespaceURI;
+ nsentry.elem = xmlListFront(writer->nodes);
+
+ curns = (xmlTextWriterNsStackEntry *)xmlListSearch(writer->nsstack,
+ (void *)&nsentry);
+ if ((curns != NULL)) {
+ xmlFree(buf);
+ if (xmlStrcmp(curns->uri, namespaceURI) == 0) {
+ /* Namespace already defined on element skip */
+ buf = NULL;
+ } else {
+ /* Prefix mismatch so error out */
+ return -1;
+ }
+ }
+
+ /* Do not add namespace decl to list - it is already there */
+ if (buf != NULL) {
+ p = (xmlTextWriterNsStackEntry *)
+ xmlMalloc(sizeof(xmlTextWriterNsStackEntry));
+ if (p == 0) {
+ xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY,
+ "xmlTextWriterStartAttributeNS : out of memory!\n");
+ return -1;
+ }
+
+ p->prefix = buf;
+ p->uri = xmlStrdup(namespaceURI);
+ if (p->uri == 0) {
+ xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY,
+ "xmlTextWriterStartAttributeNS : out of memory!\n");
+ xmlFree(p);
+ return -1;
+ }
+ p->elem = xmlListFront(writer->nodes);
+
+ xmlListPushFront(writer->nsstack, p);
+ }
+ }
+
buf = NULL;
if (prefix != 0) {
buf = xmlStrdup(prefix);
@@ -1781,34 +1878,6 @@ xmlTextWriterStartAttributeNS(xmlTextWriterPtr writer,
return -1;
sum += count;
- if (namespaceURI != 0) {
- buf = xmlStrdup(BAD_CAST "xmlns");
- if (prefix != 0) {
- buf = xmlStrcat(buf, BAD_CAST ":");
- buf = xmlStrcat(buf, prefix);
- }
-
- p = (xmlTextWriterNsStackEntry *)
- xmlMalloc(sizeof(xmlTextWriterNsStackEntry));
- if (p == 0) {
- xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY,
- "xmlTextWriterStartAttributeNS : out of memory!\n");
- return -1;
- }
-
- p->prefix = buf;
- p->uri = xmlStrdup(namespaceURI);
- if (p->uri == 0) {
- xmlWriterErrMsg(writer, XML_ERR_NO_MEMORY,
- "xmlTextWriterStartAttributeNS : out of memory!\n");
- xmlFree(p);
- return -1;
- }
- p->elem = xmlListFront(writer->nodes);
-
- xmlListPushFront(writer->nsstack, p);
- }
-
return sum;
}
@@ -1827,22 +1896,17 @@ xmlTextWriterEndAttribute(xmlTextWriterPtr writer)
int sum;
xmlLinkPtr lk;
xmlTextWriterStackEntry *p;
- xmlTextWriterNsStackEntry *np;
if (writer == NULL)
return -1;
lk = xmlListFront(writer->nodes);
if (lk == 0) {
- xmlListDelete(writer->nsstack);
- writer->nsstack = NULL;
return -1;
}
p = (xmlTextWriterStackEntry *) xmlLinkGetData(lk);
if (p == 0) {
- xmlListDelete(writer->nsstack);
- writer->nsstack = NULL;
return -1;
}
@@ -1853,45 +1917,11 @@ xmlTextWriterEndAttribute(xmlTextWriterPtr writer)
count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
if (count < 0) {
- xmlListDelete(writer->nsstack);
- writer->nsstack = NULL;
return -1;
}
sum += count;
-
- while (!xmlListEmpty(writer->nsstack)) {
- xmlChar *namespaceURI = NULL;
- xmlChar *prefix = NULL;
-
- lk = xmlListFront(writer->nsstack);
- np = (xmlTextWriterNsStackEntry *) xmlLinkGetData(lk);
-
- if (np != 0) {
- namespaceURI = xmlStrdup(np->uri);
- prefix = xmlStrdup(np->prefix);
- }
-
- xmlListPopFront(writer->nsstack);
-
- if (np != 0) {
- count =
- xmlTextWriterWriteAttribute(writer, prefix,
- namespaceURI);
- xmlFree(namespaceURI);
- xmlFree(prefix);
-
- if (count < 0) {
- xmlListDelete(writer->nsstack);
- writer->nsstack = NULL;
- return -1;
- }
- sum += count;
- }
- }
break;
-
default:
- xmlListClear(writer->nsstack);
return -1;
}
@@ -2080,38 +2110,24 @@ xmlTextWriterWriteAttributeNS(xmlTextWriterPtr writer,
{
int count;
int sum;
- xmlChar *buf;
if ((writer == NULL) || (name == NULL) || (*name == '\0'))
return -1;
- buf = NULL;
- if (prefix != NULL) {
- buf = xmlStrdup(prefix);
- buf = xmlStrcat(buf, BAD_CAST ":");
- }
- buf = xmlStrcat(buf, name);
-
sum = 0;
- count = xmlTextWriterWriteAttribute(writer, buf, content);
- xmlFree(buf);
+ count = xmlTextWriterStartAttributeNS(writer, prefix, name, namespaceURI);
+ if (count < 0)
+ return -1;
+ sum += count;
+ count = xmlTextWriterWriteString(writer, content);
+ if (count < 0)
+ return -1;
+ sum += count;
+ count = xmlTextWriterEndAttribute(writer);
if (count < 0)
return -1;
sum += count;
- if (namespaceURI != NULL) {
- buf = NULL;
- buf = xmlStrdup(BAD_CAST "xmlns");
- if (prefix != NULL) {
- buf = xmlStrcat(buf, BAD_CAST ":");
- buf = xmlStrcat(buf, prefix);
- }
- count = xmlTextWriterWriteAttribute(writer, buf, namespaceURI);
- xmlFree(buf);
- if (count < 0)
- return -1;
- sum += count;
- }
return sum;
}
@@ -2358,6 +2374,11 @@ xmlTextWriterStartPI(xmlTextWriterPtr writer, const xmlChar * target)
sum += count;
/* fallthrough */
case XML_TEXTWRITER_NAME:
+ /* Output namespace declarations */
+ count = xmlTextWriterOutputNSDecl(writer);
+ if (count < 0)
+ return -1;
+ sum += count;
count = xmlOutputBufferWriteString(writer->out, ">");
if (count < 0)
return -1;
@@ -2592,6 +2613,11 @@ xmlTextWriterStartCDATA(xmlTextWriterPtr writer)
sum += count;
/* fallthrough */
case XML_TEXTWRITER_NAME:
+ /* Output namespace declarations */
+ count = xmlTextWriterOutputNSDecl(writer);
+ if (count < 0)
+ return -1;
+ sum += count;
count = xmlOutputBufferWriteString(writer->out, ">");
if (count < 0)
return -1;
@@ -4248,6 +4274,51 @@ xmlCmpTextWriterStackEntry(const void *data0, const void *data1)
*/
/**
+ * xmlTextWriterOutputNSDecl:
+ * @writer: the xmlTextWriterPtr
+ *
+ * Output the current namespace declarations.
+ */
+static int
+xmlTextWriterOutputNSDecl(xmlTextWriterPtr writer)
+{
+ xmlLinkPtr lk;
+ xmlTextWriterNsStackEntry *np;
+ int count;
+ int sum;
+
+ sum = 0;
+ while (!xmlListEmpty(writer->nsstack)) {
+ xmlChar *namespaceURI = NULL;
+ xmlChar *prefix = NULL;
+
+ lk = xmlListFront(writer->nsstack);
+ np = (xmlTextWriterNsStackEntry *) xmlLinkGetData(lk);
+
+ if (np != 0) {
+ namespaceURI = xmlStrdup(np->uri);
+ prefix = xmlStrdup(np->prefix);
+ }
+
+ xmlListPopFront(writer->nsstack);
+
+ if (np != 0) {
+ count = xmlTextWriterWriteAttribute(writer, prefix, namespaceURI);
+ xmlFree(namespaceURI);
+ xmlFree(prefix);
+
+ if (count < 0) {
+ xmlListDelete(writer->nsstack);
+ writer->nsstack = NULL;
+ return -1;
+ }
+ sum += count;
+ }
+ }
+ return sum;
+}
+
+/**
* xmlFreeTextWriterNsStackEntry:
* @lk: the xmlLinkPtr
*
@@ -4300,8 +4371,8 @@ xmlCmpTextWriterNsStackEntry(const void *data0, const void *data1)
rc = xmlStrcmp(p0->prefix, p1->prefix);
- if (rc == 0)
- rc = p0->elem == p1->elem;
+ if ((rc != 0) || (p0->elem != p1->elem))
+ rc = -1;
return rc;
}
@@ -4568,6 +4639,11 @@ xmlTextWriterHandleStateDependencies(xmlTextWriterPtr writer,
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_NAME:
+ /* Output namespace declarations */
+ count = xmlTextWriterOutputNSDecl(writer);
+ if (count < 0)
+ return -1;
+ sum += count;
extra[0] = '>';
p->state = XML_TEXTWRITER_TEXT;
break;
diff --git a/xpath.c b/xpath.c
index 8c35e30..8f6545a 100644
--- a/xpath.c
+++ b/xpath.c
@@ -2648,9 +2648,10 @@ xmlXPathPopExternal (xmlXPathParserContextPtr ctxt) {
#define UPPER_DOUBLE 1E9
#define LOWER_DOUBLE 1E-5
+#define LOWER_DOUBLE_EXP 5
#define INTEGER_DIGITS DBL_DIG
-#define FRACTION_DIGITS (DBL_DIG + 1)
+#define FRACTION_DIGITS (DBL_DIG + 1 + (LOWER_DOUBLE_EXP))
#define EXPONENT_DIGITS (3 + 2)
/**
@@ -2701,8 +2702,16 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize)
*ptr = 0;
}
} else {
- /* 3 is sign, decimal point, and terminating zero */
- char work[DBL_DIG + EXPONENT_DIGITS + 3];
+ /*
+ For the dimension of work,
+ DBL_DIG is number of significant digits
+ EXPONENT is only needed for "scientific notation"
+ 3 is sign, decimal point, and terminating zero
+ LOWER_DOUBLE_EXP is max number of leading zeroes in fraction
+ Note that this dimension is slightly (a few characters)
+ larger than actually necessary.
+ */
+ char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
int integer_place, fraction_place;
char *ptr;
char *after_fraction;
@@ -2725,24 +2734,25 @@ xmlXPathFormatNumber(double number, char buffer[], int buffersize)
size = snprintf(work, sizeof(work),"%*.*e",
integer_place, fraction_place, number);
while ((size > 0) && (work[size] != 'e')) size--;
- after_fraction = work + size;
}
else {
/* Use regular notation */
- if (absolute_value > 0.0)
- integer_place = 1 + (int)log10(absolute_value);
- else
- integer_place = 0;
- fraction_place = (integer_place > 0)
- ? DBL_DIG - integer_place
- : DBL_DIG;
+ if (absolute_value > 0.0) {
+ integer_place = (int)log10(absolute_value);
+ if (integer_place > 0)
+ fraction_place = DBL_DIG - integer_place - 1;
+ else
+ fraction_place = DBL_DIG - integer_place;
+ } else {
+ fraction_place = 1;
+ }
size = snprintf(work, sizeof(work), "%0.*f",
fraction_place, number);
- after_fraction = work + size;
}
/* Remove fractional trailing zeroes */
+ after_fraction = work + size;
ptr = after_fraction;
while (*(--ptr) == '0')
;
@@ -3184,6 +3194,11 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
turtle_comparison:
+ if (miscNode1 != NULL)
+ node1 = miscNode1;
+ if (miscNode2 != NULL)
+ node2 = miscNode2;
+
if (node1 == node2->prev)
return(1);
if (node1 == node2->next)
@@ -4602,12 +4617,13 @@ xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node) {
return(ret);
l = xmlXPathNodeSetGetLength(nodes);
- for (i = l; i > 0; i--) {
+ for (i = l - 1; i >= 0; i--) {
cur = xmlXPathNodeSetItem(nodes, i);
if (cur == node)
break;
xmlXPathNodeSetAddUnique(ret, cur);
}
+ xmlXPathNodeSetSort(ret); /* bug 413451 */
return(ret);
}
@@ -5573,7 +5589,10 @@ xmlXPathCastNumberToString (double val) {
*/
xmlChar *
xmlXPathCastNodeToString (xmlNodePtr node) {
- return(xmlNodeGetContent(node));
+xmlChar *ret;
+ if ((ret = xmlNodeGetContent(node)) == NULL)
+ ret = xmlStrdup((const xmlChar *) "");
+ return(ret);
}
/**
@@ -14678,8 +14697,7 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp,
do {
tmp = valuePop(pctxt);
if (tmp != NULL) {
- if (tmp != NULL)
- stack++;
+ stack++;
xmlXPathReleaseObject(ctxt, tmp);
}
} while (tmp != NULL);
diff --git a/xstc/Makefile.am b/xstc/Makefile.am
index 57e1a4a..2d24f02 100644
--- a/xstc/Makefile.am
+++ b/xstc/Makefile.am
@@ -41,7 +41,7 @@ $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/M
else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi ; fi)
-@(if [ -f $(TARBALL_2) ] ; then \
echo -n "extracting test data (NIST)..." ; \
- $(TAR) -xzf $(TARBALL_2) '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \
+ $(TAR) -xzf $(TARBALL_2) --wildcards '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \
echo "done" ; \
fi)
-@(if [ ! -f $(TARBALL) ] ; then \
@@ -53,7 +53,7 @@ $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/M
else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi ; fi)
-@(if [ -f $(TARBALL) ] ; then \
echo -n "extracting test data (Sun, Microsoft)..." ; \
- $(TAR) -C Tests -xzf $(TARBALL) '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \
+ $(TAR) -C Tests -xzf $(TARBALL) --wildcards '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \
if [ -d Tests/suntest ] ; then rm -r Tests/suntest ; fi ; \
if [ -d Tests/msxsdtest ] ; then rm -r Tests/msxsdtest ; fi ; \
mv Tests/xmlschema2002-01-16/* Tests ; \
@@ -126,7 +126,7 @@ tests:
valgrind:
-@(if [ -x $(PYTHON) ] ; then \
echo '## Running the regression tests under Valgrind' ; \
- $(MAKE) CHECKER='valgrind' MAKEFLAGS+=--silent pytests ; fi);
+ $(MAKE) CHECKER='valgrind -q' MAKEFLAGS+=--silent pytests ; fi);
clean:
rm -f $(PYSCRIPTS) test.log
diff --git a/xstc/Makefile.in b/xstc/Makefile.in
index f889d3f..33533c0 100644
--- a/xstc/Makefile.in
+++ b/xstc/Makefile.in
@@ -461,7 +461,7 @@ $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/M
else echo "Dont' know how to fetch $(TARBALLURL_2)" ; fi ; fi ; fi)
-@(if [ -f $(TARBALL_2) ] ; then \
echo -n "extracting test data (NIST)..." ; \
- $(TAR) -xzf $(TARBALL_2) '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \
+ $(TAR) -xzf $(TARBALL_2) --wildcards '*/Datatypes' '*/Metadata/$(NISTTESTDEF_2)' ; \
echo "done" ; \
fi)
-@(if [ ! -f $(TARBALL) ] ; then \
@@ -473,7 +473,7 @@ $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/M
else echo "Dont' know how to fetch $(TARBALLURL)" ; fi ; fi ; fi)
-@(if [ -f $(TARBALL) ] ; then \
echo -n "extracting test data (Sun, Microsoft)..." ; \
- $(TAR) -C Tests -xzf $(TARBALL) '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \
+ $(TAR) -C Tests -xzf $(TARBALL) --wildcards '*/suntest' '*/msxsdtest' '*/$(MSTESTDEF)' '*/$(SUNTESTDEF)' ; \
if [ -d Tests/suntest ] ; then rm -r Tests/suntest ; fi ; \
if [ -d Tests/msxsdtest ] ; then rm -r Tests/msxsdtest ; fi ; \
mv Tests/xmlschema2002-01-16/* Tests ; \
@@ -546,7 +546,7 @@ tests:
valgrind:
-@(if [ -x $(PYTHON) ] ; then \
echo '## Running the regression tests under Valgrind' ; \
- $(MAKE) CHECKER='valgrind' MAKEFLAGS+=--silent pytests ; fi);
+ $(MAKE) CHECKER='valgrind -q' MAKEFLAGS+=--silent pytests ; fi);
clean:
rm -f $(PYSCRIPTS) test.log