XSL - display weblink

Posted on 2008-10-21
Last Modified: 2013-11-18
i have a weblink being returned as below

<xsl:value-of select="WebAddress"/>

the text stored in the XML is simply

How would i force this to be a weblink to open in a new window with a specific style/class applied to it?

Question by:paulCardiff
  • 2
LVL 82

Expert Comment

ID: 22770278
Instead of simply using:
<xsl:value-of select="WebAddress"/> 
<xsl:element name="a">
 <xsl:attribute name="href"><xsl:value-of select="WebAddress"/></xsl:attribute>
 <xsl:value-of select="WebAddress"/>

Open in new window


Author Comment

ID: 22774249
thanks hielo

Almost there, if you click on the link it loads

How do i force it to remove the localhost/ existing domain name when live?

Also, how do i get it to open in a new window?, can i use target="_blank"
LVL 82

Accepted Solution

hielo earned 500 total points
ID: 22776659
<xsl:element name="a">
 <xsl:attribute name="target">_blank</xsl:attribute>
 <xsl:attribute name="href">http://<xsl:value-of select="WebAddress"/></xsl:attribute>
 <xsl:value-of select="WebAddress"/>

Open in new window


Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
XSLT 5 46
Google adds suggestions 3 62
Magento Indexing 1 95
How to get statistic's from a competitors website?! 1 103
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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 learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

813 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

15 Experts available now in Live!

Get 1:1 Help Now