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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

617 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