map out SharePoint column as link through XSLT

Posted on 2012-09-08
Last Modified: 2012-09-09
I am creating an XSLT style which, as one of the requirements, pulls a url from a column, and displays the link with the anchor tag around it.

I created a custom column called "webpage", and although I am able to get the link to render, I don't know how to structure the XSLT to make the link work.

Here is what I have so far:

<xsl:template name="Aspiro-ResourceProfiles" match="Row[@Style='Aspiro-ResourceProfiles']" mode="itemstyle">
      <div class="ResourceProfile">
    	<h2><xsl:value-of select="@Title" disable-output-escaping="yes"/></h2>
    	<xsl:if test="@Byline !=''"><!-- conditional Byline if NOT empty -->
    		<p><xsl:value-of select="@Byline" disable-output-escaping="yes" /></p>
<p><a href=""><xsl:value-of select="@WebPage" disable-output-escaping="yes" /></a></p>
    	<p><xsl:value-of select="@Description" disable-output-escaping="yes" /></p>
    	<p><strong>Keywords: </strong><xsl:value-of select="@Keywords" disable-output-escaping="yes"/></p>

Open in new window

The other weird thing is that even though I can output the name it renders twice with a comma separating them. I'm not sure why.

example of duplication
Thanks for the assistance!
Question by:cnibspteam
    LVL 60

    Accepted Solution

    ><a href="{@WebPage}"><xsl:value-of select="@WebPage"/></a></

    instead of

    ><a href=""><xsl:value-of select="@WebPage" disable-output-escaping="yes" /></a></

    you need of course to fill in the href attribute
    I don't know why you see the link double
    please check it is not duplicated in the source table

    Author Comment

    Great -  that worked. Thanks.

    It seems that the duplication is caused by the type of column I used which uses the URL and Description. If you don't input a description it duplicated the URL in that field.

    I'm just going to have to use a different column instead. Thanks for the help!
    LVL 60

    Expert Comment

    by:Geert Bormans

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now