This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Copying Java expressions verbatim without character escaping?


Hi Mike,

> I'm using XSLT to create .jsp files which are mostly HTML but with a
> little JSP code dotted about in them. I want to copy a logical
> expression verbatim from my source XML to my output JSP, but I'm
> having problems if the expression contains ampersands, less-than or
> greater-than symbols. Here's an example...
[snip]
> [Notes: The stylesheet has an output method of 'html'. I'm using
> Xalan to perform the transformation. The JSP file is being created
> by means of the <xalan:write> element.]

Your use of disable-output-escaping should work, and I thought that
Xalan supported it now (have you got the latest version?). The only
place that disabling output escaping doesn't (and shouldn't) work is
if you try it within an attribute value - you cannot create an HTML
page with JSP tags (or code) within attribute values without it being
escaped.

What I'd suggest is that you change your output method to 'text'
rather than 'html'. Then you don't have to worry about escaping any of
the characters in the JSP. Of course, instead you have to worry about
serialising the HTML that you want to include within the page, but
hopefully that shouldn't be too bad - you can just wrap CDATA sections
around the relevant HTML tags in the stylesheet, and imagine that
you're creating HTML as a string rather than generating HTML elements.

Cheers,

Jeni

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]