|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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%>"/>. > > [...] > > Somewhere I read (maybe in the > specification) that is not possible to use > dissable-out-escaping to generate attributes... So my > my question is if there is a "clean" way to go around > that? How can one get the charactes < and > printed in > the attribute? 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. You have 2 practical options: 1. Non-portable vendor extensions. Saxon, for example, has an extension attribute for this purpose. See http://saxon.sourceforge.net/saxon6.5/extensions.html 2. Instead of using the short <% %> syntax for JSP, use the longer, more elegant XML syntax. See the JSP spec for this. There is a third option that is not very practical, which is to use the text output method and manually write out all your tags :) - 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








