[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: <xsl:attribute name="href"> formatting problem
I would guess that the html serializer is smart enough to know that you can't have an umlaut in a URL, but not smart enough to detect that you are in a javascript function (just a guess). I would suggest using the onclick attribute, and setting the href to # Something like: <a href="#" onclick="{concat('myFunc("',$var1, '")')}">Link</a> or if you prefer <xsl:element name="a"> <xsl:attribute name="href">#</xsl:attribute> <xsl:attribute name="onclick">myFunc("<xsl:value-of select="$var1"/>"</xsl:attribute>Link</xsl:element> which both generate: <a href="#" onclick="myFunc("Fig. 2 Struktur auswählen")">Link</a> Josh -----Original Message----- From: Bianca Poignee [mailto:bianca_p@xxxxxx] Sent: Thursday, May 06, 2004 11:26 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: <xsl:attribute name="href"> formatting problem I have a weird formatting problem with my XSL script output... :-( I am using MSXML 4.0 and >IE5.5. My script should generate an anchor with a call to a javascript function that needs a string parameter. <xsl:element name="a"><xsl:attribute name="href">javascript:myFunc('<xsl:value-of select="$var1"/>')</xsl:attribute>Link</xsl:element> The current value of var1 contains the german umlaut for "a" and some   characters ("Fig. 2 Struktur ausw#a#hlen" where the #a# is the german umlaut) If I do the transformation like written above, my result is as follows: Fig.%C2%A01%C2%A0Struktur ausw%C3%A4hlen BUT! If I use a different attribute name (like "test" instead of "href"), then my string doesn't get formattet like this, but the result is: Fig. 1 Struktur ausw#a#hlen How can I reach a formatting that doesn't come with "%C2%A0" and all that stuff when using "href"? My javascript would need to decode all of them manually otherwise.. ;-) Thanks for any help, Bianca from Germany -- "Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen! Jetzt aktivieren unter http://www.gmx.net/info
|
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
|