This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes It's boring, XSLT ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "It Watch "It New topic

It's boring, XSLT ...

Hongqing Lu

Joined: Jan 14, 2004
Posts: 13
I want to use XSLT to format xml, follows with my xml file and xsl file
XSL file
<xsl:template match="/">
<xsl:for-each select="root/user">
<td><a href=" put code here "><xsl:value-of select="Title"/></a></td>.....Line (4)
<td><xsl:value-of select="name"/></td>
In line 4 of xsl file , I want to put value of <xsl:value-of select="user_id"/> into html link, just href="<xsl:value-of select="user_id"/>"
I tried several methods to do it, anyone didn't work successfully.
How to put the value into href attribute within tag a???
Please help ....
Thanks in advance.
Ashok Mash
Ranch Hand

Joined: Oct 13, 2000
Posts: 1936
Try using <xsl:attribute>. An example,
<xsl:attribute name="href"><xsl:value-of select="user_id"/></xsl:attribute>The title part</a>
Hope this helps!

[ flickr ]
I agree. Here's the link:
subject: It's boring, XSLT ...
It's not a secret anymore!