|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] [Xsl] How to create complex dynamic href with xslt ???
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
|
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








