[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: Tom T <tomw289@xxxxxxxxxxxxxx>
Date: Tue, 22 Dec 2009 17:07:31 +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[

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?


On Fri, Nov 13, 2009 at 6:09 PM, Christopher R. Maden <crism@xxxxxxxxx>
> Tom T wrote:
>> When I use this character map:
>> <xsl:character-map name="default">
>>               <xsl:output-character character="&lt;" string="&#60;" />
>>               <xsl:output-character character=">" string="&#62;" />
>>               <xsl:output-character character="&amp;" string="&#38;amp;"
>> </xsl:character-map>
>> the unexpected behaviour occurs. When I remove the output-characters
>> and use this one:
>> <xsl:character-map name="default"/>
>> There is no problem.
>> I am using Saxon 9
> In that case:
> As several other people have suggested, there is really no need for that
> character map, if you are generating XML or HTML.  The XSLT processor
> will handle necessary escaping for you.  Since eliminating the map gives
> you correct behavior, just stop using it.
> However, it is still a bug (IMO) that that character map results in
> invalid markup; you are certainly not requesting the specific bad
> behavior youre getting.  I would file a bug against Saxon.
> ~Chris
> --
> Chris Maden, text nerd  <URL: http://crism.maden.org/ >
> The State is that great fiction by which everyone tries to live at
>  the expense of everyone else.  Fridiric Bastiat, LItat
> GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

Current Thread


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.
First Name
Last Name
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.