• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

XSLT & XPath tag in tag?

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to create a simple link in my xsl-stylesheet
But Im not able to add a parameter with XPath, like this:


What should I do, xsl must support dynamic link output?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My guess is that you're getting complaints about illegal XML, am I right?

You see, the following is not valid XML:

...since the "<"'s don't match with ">"'s.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To try snippet below:

<xsl:element name="a">
<xsl:attribute name="href">

/whatever?para=<xsl:value-of select="./@id" /></xsl:attribute>

</xsl:element>

Good luck.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try..
Either
<xsl:variable name="Para1" select="./@id"/>
<a href="/whatever?para={$Para1} />">whatever</a>

Or

<a href="/whatever?para={<xsl:value-of select="./@id" />}">whatever</a>
Not sure about the second option, but the first one shd work.
 
Sebastian Green
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Balaji Loganathan:
Try..
Either
<xsl:variable name="Para1" select="./@id"/>
<a href="/whatever?para={$Para1} />">whatever</a>

Not sure about the second option, but the first one shd work.




Thx, works like a charm!
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic