After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 60143 - Templates with pattern "/*" should not match non-document elements
Templates with pattern "/*" should not match non-document elements
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other other
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-09-06 21:18 UTC by stevecheng
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description stevecheng 2001-09-06 21:18:55 UTC
Test case:

doc.xml
--- cut ---
<a>
a text
<b>
b text
</b>
</a>
--- cut ---

rootstar-bug.xsl
--- cut ---
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">

<xsl:template match="/*">
  <xsl:value-of select="." />
</xsl:template>

<xsl:template match="/">
  <root>
    <xsl:apply-templates select="a/b" />
  </root>
</xsl:template>

<xsl:template match="*">
</xsl:template>

</xsl:stylesheet>
--- cut ---

Result:

$ xsltproc rootstar-bug.xsl doc.xml
<?xml version="1.0"?>
<root>
b text
^^^ a/b is not root element, must not match /* but *, therefore no text 
node output
</root>


This bug seems to have appeared after 1.0.0 (this is version 1.0.3), or I 
would have noticed it.  I'm looking at the source[*] of the problem right 
now, but I figured if you hear about it you will beat me to it :)


[*] In libxslt/pattern.c, line 384, should that not be:
(node->type == XML_DOCB_DOCUMENT_NODE) ?
Also I notice in some other places in the file there is no equivalent 
check for the XML_DOCB_DOCUMENT_NODE (e.g. line 758).  Are these bugs?
Comment 1 Daniel Veillard 2001-09-10 20:56:27 UTC
Yup, good catch ! That bug annoyed me for some time but
I didn't took the time to debug it yet. Thanks a lot !
Concerning the other missing XML_DOCB_DOCUMENT_NODE,
yes they are very likely to be bugs, I would appreciate
a list if you have time to chase them down :-)

  thanks again,

Daniel



Comment 2 Daniel Veillard 2001-09-15 17:46:09 UTC
Okay, this should be closed in release 1.0.4,

 thanks,

Daniel