Jump to content


Guest anri

Recommended Posts

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!

Link to post
Share on other sites

<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>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...