Re: [xsl] using jsp within xsl

Subject: Re: [xsl] using jsp within xsl
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 2 Apr 2002 14:57:24 +0100
Hi Laura,

> I think , a statement like
> <xsl:text disable-output-escaping="yes">
> &lt;&gt;
> </xsl:text>
>
> would result in an output like <> . please advice..

It would for most processors, *in element content*, but it wouldn't in
an *attribute*. You can't disable output escaping for attribute
values, only for element content. So:

  <xsl:attribute name="foo">
    <xsl:text disable-output-escaping="yes">&lt;&gt;</xsl:text>
  </xsl:attribute>

would result in:

  foo="&lt;>"

in most processors (some will generate an error, because technically
it's an error to use disable-output-escaping within an attribute
value, and some might escape the greater-than-sign with &gt;).

The only way around to include unescaped less-than signs in attribute
content is to create the entire element using disable-output-escaping.
For example:

  <xsl:text disable-output-escaping="yes">
    <![CDATA[<foo bar="<% ... %>" />]]>
  </xsl:text>

or:

  <xsl:text disable-output-escaping="yes">
    &lt;foo bar="&lt;% ... %&gt;" /&gt;
  </xsl:text>

But it's a much better idea to use the XML syntax for JSP.
  
Cheers,

Jeni

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


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


Current Thread