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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best way to find duplicate message in database 7 30
jQuery or Javascript animation question 6 66
MVC and Angular 2 91
Form submit issue 11 80
Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Shoutout to Emily Plummer ( for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

867 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

12 Experts available now in Live!

Get 1:1 Help Now