[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] need an "&" in my text!!!Please help!


Subject: Re: [xsl] need an "&" in my text!!!Please help!
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 3 Jul 2001 09:24:13 +0100

Hi Vijay,

> I need to get an ampersand symbol in my output.When I
> tried to put &amp; the xsl outputs it as is ie it is
> not replaced with "&".I tried
> disable-output-escaping="yes" option with a
> <xsl:value-of select>
> I cannot use <xsl:text> because i retrieve the value
> using a select.And when i tried to wrap the select
> with <xsl:text> it complains saying "xsl:text must not
> contain elements".
> Is there a solution.I am using XT!

If you are trying:

  <xsl:value-of select="$textWithAmpersand"
                disable-output-escaping="yes" />

and the value of $textWithAmpersand is being output with ampersands
being escaped as '&amp;', then XT doesn't support disabling output
escaping.  XT isn't fully compliant with XSLT generally, but in this
instance it is being compliant - processors don't have to support
disabling output escaping.

As you are trying to output an ampersand without it being escaped, you
must be producing something other than XML. If you tell the processor
that you're producing text rather than XML, by setting the output
method to text, then nothing will be escaped when it's output.  Try:

<xsl:output method="text" />

If you are generally producing XML but want this particular ampersand
to be unescaped (perhaps you're producing an entity reference) then
I'm afraid that you have to move to a processor that *does* support
disable-output-escaping, like Saxon, MSXML or Xalan.

Cheeers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords