[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] xsl transform question


Subject: RE: [xsl] xsl transform question
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 16 Dec 2002 20:00:06 -0000

> I am trying to create another xsl after processing one xsl.
> The reason I need this because the element "name" will be 
> availabale in another xml. In the first xsl, I have s/th like this :
> 
>    <xsl:attribute name="value"><xsl:text 
> disable-output-escaping="yes"><![CDATA[<xsl:value-of
> select="name"/>]]></xsl:text></xsl:attribute>
> 
> The output of this in my new xsl is :
> value="&lt;xsl:value-of select=&quot;name&quot;/&gt;"
> 
> I want it to be like :
> value="<xsl:value-of select="name"/>"
> because then only it would be a valid xsl.


Why are you trying to generate invalid XML? XML does not allow elements
to appear within attributes.

It is an error (in XSLT 1.0) to use disable-output-escaping for text
within an attribute node. In 2.0 (if you really need to produce invalid
XML) you can do it using <xsl:attribute disable-output-escaping="yes">.

It is also an error in 1.0 to have any instructions within <xsl:text>

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords