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

Re: Special characters in xsl

Subject: Re: Special characters in xsl
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 9 May 2000 18:50:57 +0100 (BST)
xsl remove special characters
> My problem is the next. I have a xml file like:

But why is it like that?

  <nom_div><![CDATA[altres2]]></nom_div>

is exactly the same input as

  <nom_div>altres2</nom_div>

   <content><![CDATA[<form method="post" action=""><font ....

is exactly the same input as

   <content>&lt;form method="post" action=""&gt;&lt;font ....

You say:
> When I execute the instruction: <xsl:value-of select="content"> in my
> xsl file, which is a variable field, the character < is substituted by
> &lt;

but that doesn't really describe the situation: You quoted the input
with CDATA and that is completely equivalent to quoting each individual
< as &lt;. So your xsl:value-of is just showing you the input.

> What can I do?
If the HTML fragments in your input are well formed (which seems to be
the case in your example) then remove all the CDATA markup and use
<xsl:copy-of select="content"/>  instead of value-of.

If the HTML fragments are not well formed then you are in a much worse
situation, you could try adding disable-output-encoding="yes" to your
xsl:value of, but searching the archives of this list will show why that
does not always work and is always a very fragile hack.

David


 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.