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 55722 - match priority(?) bug with namespaced attribute wildcard
match priority(?) bug with namespaced attribute wildcard
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
: 55724 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2001-06-04 20:43 UTC by stinney
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description stinney 2001-06-04 20:43:24 UTC
This xsl stylesheet:

<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:b="http://b">

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

<xsl:template match="*">
  <xsl:copy>
    <xsl:apply-templates select="*|@*"/>
  </xsl:copy>
</xsl:template>

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

</xsl:stylesheet>

should strip the attribute b:c out of the following input:

<a b:c="d" xmlns:b="http://b"/>

But instead it produces:

badnsattr$ xsltproc -V test.xsl test.xml
Using libxml 20310 and libxslt 1100
<?xml version="1.0"?>
<a xmlns:b="http://b" b:c="d"/>

Saxon produces:

<?xml version="1.0" encoding="utf-8"?>
<a xmlns:b="http://b"/>

 Steve
Comment 1 stinney 2001-06-04 20:51:20 UTC
*** Bug 55724 has been marked as a duplicate of this bug. ***
Comment 2 Daniel Veillard 2001-06-06 08:27:02 UTC
Okay, I think I fixed it. The template parsing code was wrong
and the computation of the priorities were too. This is fixed
in CVS:

gnome:~/XSLT/tests/general -> xsltproc bug-32-.xsl ../docs/bug-32-.xml 
<?xml version="1.0"?>
<a xmlns:b="http://b"/>
gnome:~/XSLT/tests/general -> 

The namespace attribute shoud probably not be generated in this case,
but I don't think it's a serious problem.

Daniel
Comment 3 stinney 2001-06-06 10:05:34 UTC
If it's any consolation, Saxon also generates the namespace; I think 
it's difficult for the processor to know what NSs will be used 
without recursing down the tree, which is an unnecessary waste of 
time (I guess you could do some clever reference-counting thing, 
but...).

The work-around is to use <xsl:element name="{name}">, which is the 
route that led me to noticing that bug.

 Steve
Comment 4 Daniel Veillard 2001-06-17 18:25:10 UTC
The fix should be included in 0.12.0, I hope this is closed too,

Daniel