[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Entity escaping/translation
At 2009-06-17 13:56 -0400, dvint@xxxxxxxxx wrote:
I have a stylesheet I've inherited. We are currently using v1 with saxon. I need to create the following output: <img src="<? echo(fldImg(2)) ?>"> Since that is not well-formed it cannot be created with XSLT 1. Even disable-output-escaping= cannot be used here because it is attribute content. but the stylesheet is producing <img src="<? echo(fldImg(2)) ?>"> I'm surprised you aren't getting: <img src="<? echo(fldImg(2)) ?>"> ... since the only sensitive character in that attribute sequence is the less-than. Can you review your output? I cannot think of a way of getting the output you cite. I tried switching the output type to text thinking that this would keep my > from changing to > Currently we are running a BB script on the output file to do a regex on this pattern, and I would like to remove that step. Then you will have to use XSLT 2 and character maps to get what you want. I hope the example below helps as it shows your desired output being created. . . . . . . . . Ken t:\ftemp>type dan.xsl <?xml version="1.0" encoding="US-ASCII"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output use-character-maps="dan" omit-xml-declaration="yes"/> <xsl:character-map name="dan"> <xsl:output-character character="￐" string="<"/> <xsl:output-character character="￑" string=">"/> </xsl:character-map> <xsl:template match="/"> <img src="￐? echo(fldImg(2)) ?￑"/> </xsl:template> </xsl:stylesheet> t:\ftemp>xslt2 dan.xsl dan.xsl <img src="<? echo(fldImg(2)) ?>"/> t:\ftemp>
|
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
|