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 110577 - Incorrect handling namespace in xsl:copy-of template
Incorrect handling namespace in xsl:copy-of template
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2003-04-11 18:14 UTC by Vasily Chekalkin
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vasily Chekalkin 2003-04-11 18:14:03 UTC
Looks like a bug with xsl:copy-of when copying node-set with many namespaces.

I use following stylesheet and xml:

----t1.xsl----
<?xml version="1.0"?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:ex="http://www.example.org/"
    version="1.0"
    >

<xsl:output method="xml" />

<xsl:template match="/">
<xsl:copy-of select="/" />
</xsl:template>

</xsl:stylesheet>
---/t1.xsl---


---t1.xml---
<?xml version="1.0"?>
<root
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:ex="http://www.example.org/"
    >
</root>
---/t1.xml---


When apply t1.xsl on t2.xsl I got:

xsltproc t1.xsl t1.xml
<?xml version="1.0"?>
<root xmlns:ex="http://www.example.org/">
</root>

but expect got t1.xml as-is.

Looks like libxslt skip some "default" namespaces.

Versions:
Using libxml 20506, libxslt 10027 and libexslt 718
xsltproc was compiled against libxml 20504, libxslt 10027 and libexslt 718
libxslt 10027 was compiled against libxml 20504
libexslt 718 was compiled against libxml 20504

If need, I cen rebuild libxslt agains libxml2-2.5.6.
Comment 1 Daniel Veillard 2003-04-23 12:31:20 UTC
Okay, fixed in CVS and example added to the test suite:

paphio:~/XSLT/tests/general -> xsltproc bug-118.xsl ../docs/bug-118.xml
<?xml version="1.0"?>
<root xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ex="http://www.example.org/">
</root>
paphio:~/XSLT/tests/general ->

  thanks for the report,

Daniel
Comment 2 Daniel Veillard 2003-07-07 13:59:58 UTC
this should be closed by release of libxslt-1.0.31
                                                                     
          
  thanks,
                                                                     
          
Daniel