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

extracting a filepath from an XML node

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Some of the nodes in my XML document contain file paths for instance:

<multimedia>
<imagepath>c:\html_test\image\a-35-52.jpg</imagepath>
<\multimedia>

I am using an xsl stylesheet to transform the XML document to HTML.
I would like to use the imagepath nodes to make links in the HTML document,
To do this I am simply using the "value-of" the imagepath node within a "href" tag in the XSL document as follows:

<xsl:for-each select="multimedia">
<a href="<xsl:value-of select="imagepath"/>">view image</a>
<p \>
</xsl:for-each>

...however it isnt working for me. Is it possible to do this? I think I might need to use an escape character or something like that.
Any suggestions?
Thanks,

Eoin.
 
Eoin Mac Aoidh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Typo there on the last <p /> tag. Whops!
 
Marshal
Posts: 28293
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<a><xsl:attribute name="href"><xsl:value-of select="imagepath"/></xsl:attribute>view image</a>
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic