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

Re: node-setting() escaped text

Subject: Re: node-setting() escaped text
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 13 Feb 2003 13:53:05 GMT
xsl unescape text
This is a FAQ and the usual answer is "don't start from here" ie arrange
that your input doc looks like <html> rather than &lt;html&gt;
but failing that....


> <xsl:apply-templates select="xx:node-set(unescape(//item))"/>

the "unescape" function would be an XML parser. Some systems may have
extension functions to parse a string, or they may support the data: URI
scheme in which case you don't need any extension at all, just

<xsl:apply-templates select="document(concat('data:text/xml,',item))"/>

should do the job. (Netscape/mozilla support data: URIs if you are not
familiar with data: try typing 
data:text/html,<b>hello</b>
into netscape's location bar)

If you don't want to apply templates and just want a copy of the input
then copy-of instead of apply-templates. In thi scase as an absolute
last resort you could consider using value-of select="item" with
disable-output-escaping="yes" but d-o-e is almost always a bad idea,
even when it works.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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


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.