Solved

XSL - display weblink

Posted on 2008-10-21
3
193 Views
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
www.domainname.com

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

thanks
0
Comment
Question by:paulCardiff
[X]
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
3 Comments
 
LVL 82

Expert Comment

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

Open in new window

0
 

Author Comment

by:paulCardiff
ID: 22774249
thanks hielo

Almost there, if you click on the link it loads
http://localhost:3292/www.domainname.co.uk

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"
0
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 22776659
try:
<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"/>
</xsl:element>

Open in new window

0

Featured Post

Technology Partners: 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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) 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…
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 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…
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:

724 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