Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

XSL - display weblink

Posted on 2008-10-21
3
Medium Priority
?
195 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
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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

578 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