This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Special characters in xsl
- To: xsl-list at mulberrytech dot com
- Subject: Re: Special characters in xsl
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Tue, 9 May 2000 18:50:57 +0100 (BST)
- References: <39184B32.CF951A38@tecn.upf.es>
- Reply-To: xsl-list at mulberrytech dot com
> 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><form method="post" action=""><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
> <
but that doesn't really describe the situation: You quoted the input
with CDATA and that is completely equivalent to quoting each individual
< as <. 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