• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

String concatenation in XSLT

 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I require to concatenate two strings in order to create a correct webpage link in my XSLT document.
A part of this string is constant, i.e.
http://www.javaranch.com
The (varying) part to be appended comes from:
<xsl:value-of select="Name"/>
Now, my question is, how can I append the two strings above in order to get the link:
"http://www.javaranch.com/whatever_name_is" around the Name tag value that will be printed out?
I'd appreciate feedback at the earliest.
Thanks,
Saket
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use so-called "attribute-value template", which is a shorthand for <xsl:value-of>. You use {} and put XPath expression inside, in your case:
<a href="http://www.javaranch.com{Name}">...
[ March 09, 2003: Message edited by: Mapraputa Is ]
 
Saket Barve
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mapraputa,
Thanks for your reply. Your direction worked like a charm!
Saket
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic