Subject: Re: [xsl] disable-output-escaping for attributes From: Victor <xsl-list@xxxxxxxxx> Date: Tue, 31 May 2005 23:09:27 +0200 |
I tried it with saxon 6.5.3 but it didn't seem to work. After reading through the docs I found this in the docs for xsl:attribute:
You can do this in XSLT 2.0 by using character maps. Assign two special characters (for example, #xAB and #x BB) to the role of "<%" and "%>" and then define a character map to replace them on serialization.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Victor [mailto:xsl-list@xxxxxxxxx] Sent: 30 April 2005 16:12
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] disable-output-escaping for attributes
Some weeks ago I began converting some HTML pages which contain asp tags to xml to have only the structure without any layout related overhead (to easy conversion to new layouts via XSL).
Some of these asp tags are "text" or could be treated as text nodes. These are the nodes I tested my xsl templates with.
However some of the HTML elements use the result of asp calls as values for attributes.
After many, many pages of really bad HTML have been manually converted I noticed to my horror that these attributes were actually escaped where I didn't want them to.
After reading a lot of other post I am lost. It seems that no one has thought about someone needing unescaped text as an attribute value and therefore "disable-output-escaping" does not work for attibutes.
Does a tool exist which supports a non-compliant mode to get the things done? Or is there a workaround?
Thanks, Victor
old HTML:
<select name="myValue">
<option valu="0" selected="<% is_sel("myValue","0","selected")%>" >0</option>
<option valu="1" selected="<% is_sel("myValue","1","selected")%>" >1</option>
</select>
XML:
<select name="myValue">
<option valu="0">
<attribute name="selected"><![CDATA[<% is_sel("myValue","0","selected")%>]]></attribute>
<text>0</text>
</option>
<option valu="1">
<attribute name="selected"><![CDATA[<% is_sel("myValue","1","selected")%>]]></attribute>
<text>1</text>
</option>
</select>
XSL:
<xsl:template match="attribute">
<xsl:attribute name="{@name}"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:attribute>
</xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] disable-output-escaping f, David Carlisle | Thread | Re: [xsl] disable-output-escaping f, David Carlisle |
Re: [xsl] xsl:number and conditiona, Wendell Piez | Date | Re: [xsl] preceding axis and contex, Wendell Piez |
Month |