Subject: [xsl] url encoding of ampersands From: Sivan Mozes <sivan@xxxxxxxxxxxxx> Date: Sun, 25 Feb 2001 00:49:36 -0800 (PST) |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] [exsl] Draft 0.1 - call f, David Carlisle | Thread | Re: [xsl] url encoding of ampersand, Mike Brown |
RE: [xsl] Escaping an apostrophe fo, Frank T. O'Connor | Date | RE: [xsl] Explorer Treeview with XS, Chris Bayes |
Month |