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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

697 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