|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] url encoding of ampersands
Greetings all. Here's a problem I'm working on: Description: A link is pointing to an anchor, whose name contains an accented character. The URL is constructed based on a text node in the XML to avoid using special characters in an attribute. Next, the stylesheet needs to replace all ampersands with %26 for URL encoding. Example: XML: <link type="anchor">Crépe</link> Expected result: <a href="#Cr%26#233;pe">Crépe</a> Template: <xsl:template match="link"> <xsl:variable name="anchor" select="concat(substring-before( . , '&'), '%26', substring-after( . , '#'))"/> ... </xsl:template> Actual result: I am unable to match on the ampersands using contains() or substring functions, but can see them in the result tree, as the entity has transformed into é. I tried various combinations of CDATA, disable-output-escaping, and others which I can't describe clearly here. translate() can see the ampersands, but I can't think of a way of using it here. Help will be greatly appreciated. Sivan 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








