xsl-list
[Top] [All Lists]

Re: disable-output-escaping

2004-03-26 12:14:13
Hi David,
Thank you for your help. But I still need to avoid having "&" as output.
I have the following code in my stylesheet and I need the exact output.
<xsl:template>
   <script>
      var tmp = "&a";
   </script>
</xsl:template>
currently it generates
var tmp = "&amp;a"; instead of var tmp = "&a";


Thank you ...




----- Original Message -----
From: "David Carlisle" <davidc(_at_)nag(_dot_)co(_dot_)uk>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Friday, March 26, 2004 12:05 PM
Subject: Re: [xsl] disable-output-escaping



The usual advice with disable output escaping is not to use it.
Especially in this case.


  I'm trying to avoid to have &amp; as output.
  So I use <xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text> .
  I don't know if it's the right thing to do.


Just use &#160; no need for d-o-e at all.


  I'm trying to avoid to have &amp; as output in my URI(s) (ie:
  http://server/tmp.jsp?a=1&amp;b=2)


Why? The URI just has an & but like all & in HTML or XML this must be
quoted of you put that URI in a document. if you succeed in getting XSLT
not to quote it (which is quite hard as XSLT tries hard to force you to
do the right thing) then you will just have managed to produce a
document that is invalid html or not well formed xhtml.

David


--
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
You are subscribed as: cohana(_at_)investacorp(_dot_)com
To unsubscribe, go to:
http://lists.mulberrytech.com/unsub.php/xsl-list/cohana(_at_)investacorp(_dot_)com
or e-mail:
<mailto:xsl-list-unsubscribe-cohana=investacorp(_dot_)com(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--




<Prev in Thread] Current Thread [Next in Thread>