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

RE: using xsl:output-character to render characters in

Subject: RE: using xsl:output-character to render characters in 2 ways
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 12 Nov 2009 12:47:18 -0000
RE:  using xsl:output-character to render characters in
(a) character maps apply to all characters in the result tree, regardless
whether they originated in the source document or the stylesheet.

(b) there's something fishy about your requirements that make one wants to
probe deeper. If you care whether or not numeric character references are
used in the result document, then you're not using XML the way it was
designed to be used.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

> -----Original Message-----
> From: Tom T [mailto:tomw289@xxxxxxxxxxxxxx] 
> Sent: 12 November 2009 12:16
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  using xsl:output-character to render 
> characters in 2 ways
> 
> I wish to process single quotes in the following way:
> 
> - when it is retreived from the source XML it should be 
> escaped to &#39;
> 
> - when it is embedded within the XSLT stylesheet it should 
> not be escaped and rendered as a '.
> 
> To acheive this I have set up the following output-characters 
> in a character map:
> 
> <xsl:output-character character="&#39;" string="&#38;#39;" /> 
> <xsl:output-character character="&single-quote;" string="&#39;" />
> 
> This works but it means I have to use the &single-quote; 
> entity every time I want to use a single quote in the xslt 
> (eg for javascript.)
> 
> Is there a better way to do this in XSLT 2?
> 
> Thanks

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.