Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dynamic Link in XSLT?

Posted on 2003-11-25
5
Medium Priority
?
822 Views
Last Modified: 2013-11-18
Hi All.

In my xslt, I need to have a hyperlink that links to
a)a new window (300w * 500h)
b)sends a querystring to that window based on a node value in the xml.

Usually, when doing straight ASP, I'd use Javascript and put the variable in the querystring.

I tried this, to no avail:

<a href="javascript:new_window('display_invoice.asp?Document="<xsl:value-of select="document"/>"')">
                    <xsl:value-of select="document"/>
</a>

Any ideas??

Thanks!
0
Comment
Question by:ClassyLinks
[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
5 Comments
 
LVL 26

Expert Comment

by:rdcpro
ID: 9818236
I assume you have a function like:

function new_window(sUrl)
{
var oNewWindow = window.open(sUrl, "ClassyWindow", "heght=500, width=300")
}

This might be in your XSLT, or it mignt be in a Javascript file loaded from a <link> tag.

Regards,
Mike Sharp
0
 
LVL 7

Author Comment

by:ClassyLinks
ID: 9818291
Yes, I have that.

How can I code the variable for the document number into the link?
0
 
LVL 26

Expert Comment

by:rdcpro
ID: 9818422
I don't know what you mean by document number.  There is a node in the XML like <document> that you're using for this?  Or is "document" a variable name?  You're not talking about the XPath document() function, right?

Regards,
Mike Sharp
0
 
LVL 3

Accepted Solution

by:
savalou earned 500 total points
ID: 9818468
Try putting just the element in curly braces:
<a href="javascript:new_window('display_invoice.asp?Document={document}/>')"/>
                   <xsl:value-of select="document"/>

Or else you should use an xsl:attribute tag to create the href attribute.
<a>
<xsl:attribute name="href">javascript:new_window('display_invoice.asp?Document="<xsl:value-of select="document"/>"')
</xsl:attribute>
</a>
I'm not sure about whether all the quotes and tags come out right, perhaps you can try it out.
0
 
LVL 7

Author Comment

by:ClassyLinks
ID: 9818645
Thanks to you both!

The xsl:attribute did the trick.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

610 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