Guest anri Posted October 12, 2005 Report Share Posted October 12, 2005 I have some problems with Hyper Linking in XMLI’m using XSL style sheet to present XML file.XML looks like this<root>…<employers><name>John</name><title>boss</title><hlink>http://www.john.com</hlink><name>Mike</name><title>Assistent</title><hlink>http://www.mike.com</hlink></employers>…</root>and there are other users…in XSL I’m using<table> <tr> <th align="left">Title</th> <th align="left" width="550">Name</th> </tr> <xsl:for-each select="root/employers"> <tr> <td>[Title] <xsl:value-of select="title"/></td> <td>[Name]<xsl:value-of select="name"/></td> </tr> </xsl:for-each> </table>that's all easy, but I got stuck with hyper linksHow should I apply <hlink> element to <name> via XSL? to make it look like:boss: John // if you click on 'John' it takes to http://www.john.comAssistant: Mike // if you click on 'Mike' it takes to http://www.mike.com and so on...seems to be easy... but I don't know how toif you know how to please let me know! thanks in advance! Quote Link to post Share on other sites
Helbira 0 Posted October 18, 2005 Report Share Posted October 18, 2005 <table><tr><th align="left">Title</th><th align="left" width="550">Name</th></tr><xsl:for-each select="root/employers"><tr><td>[Title] <xsl:value-of select="title"/></td><td>[Name]<a><xsl:attribute name="href"><xsl:value-of select ="hlink"/></xsl:attribute><xsl:value-of select="name"/></a></td></tr></xsl:for-each></table> Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.