1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2026-01-07 21:58:22 +03:00

fixed the behaviour of node() patter which didn't patch the one defined in

* libxslt/pattern.c: fixed the behaviour of node() patter which
  didn't patch the one defined in XPath :-( . Closes bug #95793
* tests/docs/Makefile.am tests/docs/bug-92.xml
  tests/general/Makefile.am tests/general/bug-92.*: added the
  example in the regression tests for this case
Daniel
This commit is contained in:
Daniel Veillard
2002-10-15 09:45:29 +00:00
parent 532469fa6f
commit 117597ebab
7 changed files with 63 additions and 6 deletions

View File

@@ -1,3 +1,11 @@
Tue Oct 15 11:40:19 CEST 2002 Daniel Veillard <daniel@veillard.com>
* libxslt/pattern.c: fixed the behaviour of node() patter which
didn't patch the one defined in XPath :-( . Closes bug #95793
* tests/docs/Makefile.am tests/docs/bug-92.xml
tests/general/Makefile.am tests/general/bug-92.*: added the
example in the regression tests for this case
Mon Oct 14 12:29:53 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de>
* libxslt/win32config.h: remapped mkdir to _mkdir for MS runtime

View File

@@ -939,17 +939,11 @@ wrong_index:
break;
case XSLT_OP_NODE:
switch (node->type) {
case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE:
#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE:
#endif
case XML_ELEMENT_NODE:
case XML_CDATA_SECTION_NODE:
case XML_PI_NODE:
case XML_COMMENT_NODE:
case XML_TEXT_NODE:
case XML_ATTRIBUTE_NODE:
break;
default:
return(0);

View File

@@ -91,6 +91,7 @@ EXTRA_DIST = \
bug-89.xml \
bug-90.xml \
bug-91.xml \
bug-92.xml \
character.xml \
array.xml \
items.xml

19
tests/docs/bug-92.xml Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xsl:output method="xml" indent="yes" version="1.0"/>
<xsl:template match="node()">
<xsl:element name="toto">
<xsl:attribute name="n">
<xsl:value-of select="name()"/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="text()"/>
<xsl:template match="comment()"/>
<xsl:template match="processing-instruction()"/>
</xsl:stylesheet>

View File

@@ -94,6 +94,7 @@ EXTRA_DIST = \
bug-89.out bug-89.xsl \
bug-90.out bug-90.xsl \
bug-91.out bug-91.xsl \
bug-92.out bug-92.xsl \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl \

15
tests/general/bug-92.out Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<toto n="xsl:stylesheet">
<toto n="xsl:output"/>
<toto n="xsl:template">
<toto n="xsl:element">
<toto n="xsl:attribute">
<toto n="xsl:value-of"/>
</toto>
<toto n="xsl:apply-templates"/>
</toto>
</toto>
<toto n="xsl:template"/>
<toto n="xsl:template"/>
<toto n="xsl:template"/>
</toto>

19
tests/general/bug-92.xsl Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xsl:output method="xml" indent="yes" version="1.0"/>
<xsl:template match="node()">
<xsl:element name="toto">
<xsl:attribute name="n">
<xsl:value-of select="name()"/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="text()"/>
<xsl:template match="comment()"/>
<xsl:template match="processing-instruction()"/>
</xsl:stylesheet>