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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

743 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

12 Experts available now in Live!

Get 1:1 Help Now