Solved

In XSL How do I add a string after a hyperlink,, that should NOT be included as part of the hyperlink

Posted on 2014-03-12
2
237 Views
Last Modified: 2014-03-12
In my XSL I am creating a href by calling the javascript OpenMetaData and passing in a value.  When displaying the link in the browser window from my XSL, I want to display the link along with some text that should NOT be included in the href/link.

This gives an error loading xsl doc: (It doesn't seem to like the line feed that I specified)

<td valign="center" class="tableentry">

                <xsl:element name="a">

                                <xsl:attribute name="href">

                                                javascript:OpenMetadata(244,'U','<xsl:value-of select="$lstactivities[1]/instructorid" />','','MDT','width=600,height=650,left=50,top=50,resizable=no');

                                </xsl:attribute>

                                <xsl:value-of select="$lstactivities[1]/instructor" />

                                <xsl:value-of select="&#x0D" />

                                <xsl:text>(</xsl:text><xsl:value-of select="$countofdays" /><xsl:text>)</xsl:text>

                </xsl:element>

This one includes the text (parentheses, number, parentheses) as part of the hyperlink, so the hyperlink no longer works):
This works as far as xsl – but hyperlink is incorrect

   <td valign="center" class="tableentry">

                   <xsl:element name="a">

                                 <xsl:attribute name="href">

                                                       javascript:OpenMetadata(244,'U','<xsl:value-of select="$lstactivities[1]/instructorid" />','','MDT','width=600,height=650,left=50,top=50,resizable=no');

                                     </xsl:attribute>
                                      <xsl:value-of select="$lstactivities[1]/instructor" />

                                      <xsl:text>(</xsl:text><xsl:value-of select="$countofdays" /><xsl:text>)</xsl:text>

                  </xsl:element>

Basically, right after the actual hyperlink, I need a line feed/carriage return, before specifying the text.
0
Comment
Question by:avivap
  • 2
2 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39924937
avoid the whitespace nodes by using <xsl:text>
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 39924944
<xsl:attribute name="href">
<xsl:text>javascript:OpenMetadata(244,'U','</xsl:text>
<xsl:value-of select="$lstactivities1]/instructorid" />
<xsl:text>','','MDT','width=600,height=650,left=50,top=50,resizable=no');</xsl:text>       </xsl:attribute>

Open in new window

0

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

929 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

14 Experts available now in Live!

Get 1:1 Help Now