[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 ???

Subject: [Xsl] How to create complex dynamic href with xslt ????
From: <pippo@xxxxxxxxxx>
Date: Tue, 1 Mar 2005 19:47:47 +0100
dynamic href
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&amp;mod={TEMPLATE}&amp;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:

   &lt;a href=http://mysite/drv?expert&amp;mod=<xsl:value-of
select=TEMPLATE/>&amp;IDMENU=<xsl:value-of select=@MENU_ID/> &gt; dummy
 text &lt;/a&gt;

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&amp;mod=]]><xsl:value-of
select=TEMPLATE/> <![CDATA[&amp;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 &lt; / &gt; sequences by the xslt processor.

What is the right way to manage a so stupid transformation ?

Thanks,
      Paolo

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.