[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

JSP 'XML-like' syntax isn't totally (was RE: symbols <

Subject: JSP 'XML-like' syntax isn't totally (was RE: symbols < and > in attribute)
From: sara.mitchell@xxxxxxxxx
Date: Tue, 11 Dec 2001 15:07:28 -0500
jsp xml
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:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.