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
240 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Wordpress Cron - Send XML Data to external server FTP 3 23
Filktering Alphabetically 8 32
Can't get page to reload 9 13
MS SQL + date 6 23
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

828 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