Putting an xslt variable into href link

Posted on 2008-11-05
Last Modified: 2013-11-18
Is there a way to put the value of an xslt variable into an attribute of the html into which your transforming the xml?

For example,

<xsl:variable name="hrefLink" select="hrefLinkNode"/>
<a href="????">MyLink</a>

Is there something I can put into the ???? to have it take the value of $hrefLink?
Question by:HyperBPP
    1 Comment
    LVL 60

    Accepted Solution

    <a href="{$hrefLink}">MyLink</a>

    {} are attribute value templates, specially for that

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    758 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

    9 Experts available now in Live!

    Get 1:1 Help Now