Re: [xslt] xsl:copy-of does not preserve disable-output-escaping



This was previously reported as bug #140755, and was fixed in CVS as of 1
May 2004.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs sagehill net


----- Original Message ----- > Date: Thu, 03 Jun 2004 15:22:08 +0000
> From: Vladimir Grebenschikov <vova sw ru>
> Subject: [xslt] xsl:copy-of does not preserve disable-output-escaping
> flag on text nodes
> Hi
>
> -- test.xsl--
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>
>   <xsl:output method="html" encoding="utf-8"/>
>
>   <xsl:template name="x">
>         <xsl:text disable-output-escaping="yes">
>            &lt;mytag/&gt;
>         </xsl:text>
>   </xsl:template>
>
>   <xsl:template match="/">
>         Just call template
>         <xsl:call-template name="x"/>;
>
>         Copy-Of result of template call:
>         <xsl:variable name="test">
>           <xsl:call-template name="x"/>
>         </xsl:variable>
>         <xsl:copy-of select="$test"/>;
>   </xsl:template>
>
> </xsl:stylesheet>
> ----
>
> % xsltproc test.xsl test.xsl
>
>         Just call template
>
>            <mytag/>
>         ;
>
>         Copy-Of result of template call:
>
>            &lt;mytag/&gt;
>         ;
>
>
> Following patch will fix this problem:
>
> --- libxslt-1.1.6/libxslt/transform.c.orig      Thu Jun  3 18:40:12 2004
> +++ libxslt-1.1.6/libxslt/transform.c   Thu Jun  3 18:41:20 2004
> @@ -962,7 +962,7 @@
>             break;
>          case XML_TEXT_NODE:
>          case XML_CDATA_SECTION_NODE:
> -           return(xsltCopyTextString(ctxt, insert, node->content, 0));
> +           return(xsltCopyTextString(ctxt, insert, node->content,
> node->name == xmlStringTextNoenc));
>          case XML_ATTRIBUTE_NODE:
>             return((xmlNodePtr)
>                    xsltCopyProp(ctxt, insert, (xmlAttrPtr) node));
>
>
>
>
> ------------------------------
>
> _______________________________________________
> xslt mailing list
> xslt gnome org
> http://mail.gnome.org/mailman/listinfo/xslt
>
>
> End of xslt Digest, Vol 2, Issue 2
> **********************************
>
>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]