Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
244 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
[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
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 1500 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

721 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