Solved

XSL - display weblink

Posted on 2008-10-21
3
187 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
  • 2
3 Comments
 
LVL 82

Expert Comment

by:hielo
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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 receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

772 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