• 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

doubt in href

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 : sethurajan@rediffmail.com
Please clear my doubt
with hope,
sethu
(sethurajan@rediffmail.com)
 
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
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"?>
<root>
<message-no>120</message-no>
<from-id>GPT20</from-id>
</root>
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>
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic