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 70281 - Namespace handling in variable RTF
Namespace handling in variable RTF
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
1.0.10
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2002-02-01 16:13 UTC by fabrice.desre
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description fabrice.desre 2002-02-01 16:13:08 UTC
When using a variable to output a RTF, the root
element looses its namespace :
When applying this stylesheet on itself :
<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:ns1="urn:test">

<xsl:output encoding="iso-8859-1" method="xml"/>

<xsl:template match="/">
<xsl:variable name="out">
<ns1:root>
<ns1:child>It only fails for the root element !</ns1:child>
<xsl:apply-templates />
</ns1:root>
</xsl:variable>
<xsl:copy-of select="$out"/>
</xsl:template>

</xsl:stylesheet>

We get :
<?xml version="1.0" encoding="iso-8859-1"?>
<root xmlns:ns1="urn:test"><ns1:child>It only fails for the root element
!</ns1:child>
It only fails for the root element !
</root>

Where I think you should get :
<?xml version="1.0" encoding="iso-8859-1"?>
<ns1:root xmlns:ns1="urn:test"><ns1:child>It only fails for the root
element !</ns1:child>
It only fails for the root element !
</ns1:root>
Comment 1 Daniel Veillard 2002-02-10 15:20:48 UTC
1 line patch but hard to track !
Here is the patch fixing that bug:

===================================================================
*** libxslt/transform.c	2002/01/27 12:56:30	1.162
--- libxslt/transform.c	2002/02/10 15:17:45
***************
*** 624,630 ****
  	if (node->nsDef != NULL)
  	    xsltCopyNamespaceList(ctxt, copy, node->nsDef);
  	if (node->ns != NULL) {
! 	    copy->ns = xsltGetNamespace(ctxt, node, node->ns, insert);
  	}
  	if (node->properties != NULL)
  	    copy->properties = xsltCopyPropList(ctxt, copy,
--- 624,630 ----
  	if (node->nsDef != NULL)
  	    xsltCopyNamespaceList(ctxt, copy, node->nsDef);
  	if (node->ns != NULL) {
! 	    copy->ns = xsltGetNamespace(ctxt, node, node->ns, copy);
  	}
  	if (node->properties != NULL)
  	    copy->properties = xsltCopyPropList(ctxt, copy,
==================================================================

  thanks for the report,

Daniel
Comment 2 Daniel Veillard 2002-02-12 08:42:25 UTC
Fixed in libxslt-1.0.12,

 thanks for the report,

Daniel