Adding a variable href attribute to a hyperlink using XSLT

Posted by Pete on Stack Overflow See other posts from Stack Overflow or by Pete
Published on 2014-08-13T21:43:43Z Indexed on 2014/08/25 16:20 UTC
Read the original article Hit count: 206

Filed under:
|

I need to create links using dynamic values for both the URL and the anchor text.

I have column called URL, which contains URL's, i.e., http://stackoverflow.com, and I have a column called Title, which contains the text for the anchor, i.e., This Great Site.

I figure maybe all I need to do is nest this tags, along with a little HTML to get my desired result:

<a href=">
    <xsl:value-of select="@URL">">
        <xsl:value-of select="@Title"/>
    </xsl:value-of>
</a>

In my head, this would render:

<a href="
    http://stackoverflow.com">
        This Great Site
</a>

I know there's more to it, but I haven't been able to clearly understand what more I need. I think this issue has been addressed before, but not in a way I could understand it. I'd be more than happy to improve the question's title to help noobs like myself find this item, and hopefully an answer.

Any help is greatly appreciated.

© Stack Overflow or respective owner

Related posts about xslt

Related posts about nested