Subject: [xsl] [Xsl] How to create complex dynamic href with xslt ???? From: <pippo@xxxxxxxxxx> Date: Tue, 1 Mar 2005 19:47:47 +0100 |
I have a very simple xslt problem but apparently without a solution: Im using per xml:xslt package (latest version, 0.48) . Inside an xslt transformation template I have to generate dynamic javascript href where some URL parameter depend on input xml document. For example I have to generate something like: <a href=http://mysite/drv?expert&mod={TEMPLATE}&IDMENU={@MENU_ID}> dummy text </a> where, obvioulsly, {TEMPLATE} and {@MENU_ID} are attribute value template. The problem is that the xslt processor is not able to recognize them as attribute value templates because the syntax is not so plain. Every example I saw about attribute value template show how to use them in very very simple situations (not in the real world !!) like the following one: <person id = "{@id}"/> where the attribute value template is well recognizable by the xslt processor. To solve my problem I also tried something like: <a href=http://mysite/drv?expert&mod=<xsl:value-of select=TEMPLATE/>&IDMENU=<xsl:value-of select=@MENU_ID/> > dummy text </a> but, obviously, it generates not correct html syntax ( in fact I have to produce unescaped < and > characters ..) I also tried to use CDATA with a syntax like: <![CDATA[<a href=http://mysite/drv?expert&mod=]]><xsl:value-of select=TEMPLATE/> <![CDATA[&IDMENU=]]><xsl:value-of select=@MENU_ID/> <![CDATA[> dummy text </a>]]> But also in this way I got a wrong result because angle brackets are transformed in < / > sequences by the xslt processor. What is the right way to manage a so stupid transformation ? Thanks, Paolo
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] speed difference between , Joris Gillis | Thread | [xsl] Problem with encoding using d, António Mota |
[xsl] speed difference between IE a, Sean Whalen | Date | RE: [xsl] Separating XSLT 1 and 2 h, JBryant |
Month |