[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: disable-output-escaping for attributes

Subject: RE: disable-output-escaping for attributes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 31 May 2005 16:19:39 +0100
html disabled
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:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.