Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

doubt in href  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Respected sir,
I am working in java and xml. In my project, I have a situation to select a xml data using xsl within href but have lot of error messages yet.
I browse your web page but I am not clear about it. Please clear my doubt.
problem in : <a href="http://localhost:8080/test/servlet/WebShowMail?msno=<xsl:value-of select='message-no'/>&folder=inbox"><xsl:value-of select="from-id"/></a>
about it :WebShowMail -servlet to be connect .
:msno - parameter of servlet to be pass, which is a
xml data within the tag <message-no>
: I select that xml data by xsl using <xsl:value-of select='message-no'/>
:<xsl:value-of select="from-id"/> -data on which href link to be apply
error :'<' character can't be used in attribute value.
mail to me :
Please clear my doubt
with hope,
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, <xsl:value-of> cannot be used in attribute values �as is�, there is a shorcut for it: {Xpath expression}. It means the same as <xsl:value-of select=� Xpath expression�>
Next, �&�� sign cannot appear in an attribute value, it has to be written as �&amp;�.
Suppose your XML is (for example! ):
<?xml version="1.0"?>
Then in your XSL stylesheet you should write
<a href="http://localhost:8080/test/servlet/WebShowMail?msno={root/message-no}&amp;folder=inbox">
<xsl:value-of select="root/from-id"/></a>
The output:
<a href="http://localhost:8080/test/servlet/WebShowMail?msno=120&folder=inbox">GPT20</a>
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
how do I do my own kindle-like thing - without amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!