JSP 'XML-like' syntax isn't totally (was RE: [xsl] symbols < and > in attribute)

Subject: JSP 'XML-like' syntax isn't totally (was RE: [xsl] symbols < and > in attribute)
From: sara.mitchell@xxxxxxxxx
Date: Tue, 11 Dec 2001 15:07:28 -0500
Unfortunately, the XML-like syntax for JSP is not *always* 
identical. Doesn't look like it affects this example, but 
there is at least one situation where you can't use the 
XML-like syntax in JSP: <%@include file="URI" %> is not 
functionally equivalent to <jsp:include file="uri"/>. 

My limited understanding is that the first construct is
compiled in the JSP before execution while the latter
is a run-time include and this can affect performance. 
(Please don't strike with lightening here -- I'm quoting
someone who knows JSP, not speaking out of personal 
understanding :)

So, if you're stuck in a situation where the XML-like syntax
doesn't work, there is a third alternative *if* you are 
using a processor that supports disable-output-escaping --
to treat the entire line for the start-tag *and* the line 
for the end-tag for the node using JSP variables as a text 
string. It isn't elegant, but it does work (having had 
precisely this same problem). 

You end up with things that look like this in your templates: 

<xsl:text disable-output-escaping="yes"><![CDATA[<body class="helpBodyText"
<%=bodyAttributes%>>]]>
</xsl:text>

or like this: 

<xsl:text disable-output-escaping="yes"><![CDATA[<%@include
file="/communities/ebiz/inc/vars.jsp" %>]]></xsl:text>

Sara
> -----Original Message-----
> From: Mike Brown [mailto:mike@xxxxxxxx]
> Sent: Tuesday, December 11, 2001 9:18 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] symbols < and > in attribute
> 
> 
> Ernesto Reinaldo wrote:
> > I'm generating JSP pages from an XML document and in
> > these pages I need to have tags of the following form
> > 
> > <mytag ttr1="<%= value%>"/>.
> >
> > [...]
> > So my
> > my question is if there is a "clean" way to go around
> > that? 
>> [...]
> That's correct, there is no way to do this in XSLT when using the HTML
> or XML output methods, not even by using 
> disable-output-escaping, since 
> disable-output-escaping is only allowed to affect text nodes, if it is
> supported at all.
> [...]
>    - Mike
> ______________________________________________________________
> ______________
>   mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
>   denver/boulder, colorado, usa   |  personal: 
> http://hyperreal.org/~mike/
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

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


Current Thread