[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: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 22 Dec 2009 17:20:07 +0000
Re:  using xsl:output-character to render characters in
>> One of the reasons I am using a character map in this example is to
>> create a CDATA section in the output:
>>
>> <script type="text/javascript">//<![CDATA[
>> some.onload(function(){
>> });
>> //]]></script>
>>
>> As I need '//' to appear before the CDATA section I cannot use the
>> cdata-section-elements <xsl:output/> attribute.
>>
>> (Here's an example of why I need the '//':
>> http://javascript.about.com/library/blxhtml.htm )
>>
>> Is there a way I can produce this kind of CDATA section in the output
>> without resorting to character maps?
>
> Though I loath to recommend it, you could use disable-output-escaping= as
> follows:
>
> <script type="text/javascript">//<xsl:text
> disable-output-escaping="yes">&lt;</xsl:text>![CDATA[
> some.onload(function(){
> }};
> //<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text></script>

Or if you use the "html" output method, then

<script type="text/javascript">//&lt;![CDATA[
some.onload(function(){
});
//]]&gt;</script>

should serialise as

<script type="text/javascript">//<![CDATA[
  some.onload(function(){
  });
  //]]>
</script>

-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.