1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

Fixes inherited from XSLT testing:

- xpath.c result/XPath/tests/chaptersbase
  result/XPath/tests/simplebase: fixed XPath node()
- tree.c: small fix in xmlNewNs()
- Makefile.am: removed extraneous xml2Conf.sh rule
Daniel
This commit is contained in:
Daniel Veillard 2001-01-31 13:23:49 +00:00
parent 9cb5ff4e6a
commit 2f913b7470
6 changed files with 44 additions and 17 deletions

View File

@ -1,3 +1,10 @@
Wed Jan 31 14:19:16 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* xpath.c result/XPath/tests/chaptersbase
result/XPath/tests/simplebase: fixed XPath node()
* tree.c: small fix in xmlNewNs()
* Makefile.am: removed extraneous xml2Conf.sh rule
Sun Jan 28 08:37:03 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* Makefile.am configure.in libxml.spec.in example/Makefile.am:

View File

@ -414,11 +414,11 @@ EXTRA_DIST = xml2Conf.sh.in libxml.spec.in libxml.spec libxml.m4 \
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxml-2.0.pc
xml2Conf.sh: xml2Conf.sh.in Makefile
## Use sed and then mv to avoid problems if the user interrupts.
sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \
-e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
-e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \
-e 's?\@VERSION\@?$(VERSION)?g' \
< $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \
&& mv xml2Conf.tmp xml2Conf.sh
#xml2Conf.sh: xml2Conf.sh.in Makefile
### Use sed and then mv to avoid problems if the user interrupts.
# sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \
# -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
# -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \
# -e 's?\@VERSION\@?$(VERSION)?g' \
# < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \
# && mv xml2Conf.tmp xml2Conf.sh

View File

@ -71,8 +71,12 @@ Set contains 1 nodes:
========================
Expression: /child::EXAMPLE/child::head/node()
Object is a Node Set :
Set contains 1 nodes:
1 ELEMENT title
Set contains 3 nodes:
1 TEXT
content=
2 ELEMENT title
3 TEXT
content=
========================
Expression: /descendant::title

View File

@ -52,8 +52,12 @@ Set contains 1 nodes:
========================
Expression: /child::EXAMPLE/child::head/node()
Object is a Node Set :
Set contains 1 nodes:
1 ELEMENT title
Set contains 3 nodes:
1 TEXT
content=
2 ELEMENT title
3 TEXT
content=
========================
Expression: /descendant::title

3
tree.c
View File

@ -120,6 +120,9 @@ xmlNsPtr
xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix) {
xmlNsPtr cur;
if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
return(NULL);
/*
* Allocate a new Namespace and fill the fields.
*/

19
xpath.c
View File

@ -516,7 +516,7 @@ xmlXPatherror(xmlXPathParserContextPtr ctxt, const char *file,
* Compare two nodes w.r.t document order
*
* Returns -2 in case of error 1 if first point < second point, 0 if
* that's the same point, -1 otherwise
* that's the same node, -1 otherwise
*/
int
xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) {
@ -2914,10 +2914,10 @@ typedef enum {
} xmlXPathTestVal;
typedef enum {
NODE_TYPE_NODE = 0,
NODE_TYPE_COMMENT = XML_COMMENT_NODE,
NODE_TYPE_TEXT = XML_TEXT_NODE,
NODE_TYPE_PI = XML_PI_NODE,
NODE_TYPE_NODE = XML_ELEMENT_NODE
NODE_TYPE_PI = XML_PI_NODE
} xmlXPathTypeVal;
#define IS_FUNCTION 200
@ -3050,6 +3050,10 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, xmlXPathAxisVal axis,
" context contains %d nodes\n",
nodelist->nodeNr);
switch (test) {
case NODE_TEST_NODE:
xmlGenericError(xmlGenericErrorContext,
" searching all nodes\n");
break;
case NODE_TEST_NONE:
xmlGenericError(xmlGenericErrorContext,
" searching for none !!!\n");
@ -3109,9 +3113,14 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, xmlXPathAxisVal axis,
return;
case NODE_TEST_TYPE:
if ((cur->type == type) ||
((type == XML_ELEMENT_NODE) &&
((type == NODE_TYPE_NODE) &&
((cur->type == XML_DOCUMENT_NODE) ||
(cur->type == XML_HTML_DOCUMENT_NODE)))) {
(cur->type == XML_HTML_DOCUMENT_NODE) ||
(cur->type == XML_ELEMENT_NODE) ||
(cur->type == XML_PI_NODE) ||
(cur->type == XML_COMMENT_NODE) ||
(cur->type == XML_CDATA_SECTION_NODE) ||
(cur->type == XML_TEXT_NODE)))) {
#ifdef DEBUG_STEP
n++;
#endif