[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Question regarding XSL and Javascript

Subject: RE: Question regarding XSL and Javascript
From: Frank van Puffelen <puf@xxxxxxxxxxxxxx>
Date: Fri, 21 Sep 2001 08:08:13 +0200
van puffelen
Sanjeev,

I think the folowing should work:
        <a
href="javascript:window.parent.openWorkWindow('customerWorkWindow17',
'Household Details by Member', 
	
'http://localhost/testpage/servlet/RequestHandler?ActionID=FindHousehold%26C
ustomerID={/Customer/customerID}%26DISFunction=Retrieve%26DISHtml=/presentat
ions/html/MemberDetail.HTM')">
	<xsl:value-of select="firstName"/> <xsl:value-of
select="lastName"/></a>

Notice the part of the URL that is inside curly braces. This is what's known
as an attribute value template and it inserts the value of the requested
node.

As an alternative, you can construct the URL by using the concat-function.
	<xsl:variable name="url"
select="concat('http://localhost/testpage/servlet/RequestHandler?ActionID=Fi
ndHousehold %26CustomerID=', /Customer/customerID,
'%26DISFunction=Retrieve%26DISHtml=/presentations/html/MemberDetail.HTM')"/>
      <a
href="javascript:window.parent.openWorkWindow('customerWorkWindow17',
'Household Details by Member', {$url})">
		<xsl:value-of select="firstName"/> <xsl:value-of
select="lastName"/>
	</a>

Notice the use of an attribute value template in the href to retrieve the
value of the url variable. The use of a variable is not strictly necessary,
but it might help to keep your stylesheet more readable.

Kind regards,

		puf

-----Original Message-----
From: Sanjeev Pai [mailto:sanjeevpai@xxxxxxxxx] 
Sent: 21 September, 2001 1:05 
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Question regarding XSL and Javascript


Hi,

I am trying to get a dynamic Javascript URL generated by XSL, but the code
keeps getting stuck with the parser. I went through the FAQs and archives
and read the messages about AVT and using disable-output-escaping. Problem
is that none of these techniques work with the link. A sample of the code is
shown below -

<xsl:for-each select="Customer">
  <tr>
    <td align="left">
      <xsl:if test="position() mod 2 > 0">
        <a
href="javascript:window.parent.openWorkWindow('customerWorkWindow17',
'Household Details by Member',
'http://localhost/testpage/servlet/RequestHandler?ActionID=FindHousehold%26C
ustomerID=123001%26DISFunction=Retrieve%26DISHtml=/presentations/html/Member
Detail.HTM')">
                    <xsl:value-of select="firstName"/> <xsl:value-of
select="lastName"/></a>
				</xsl:if>
  </td>
</tr>
</xsl:for-each>

In this code, the value 123001 actually needs to be replaced with
Customer/customerID. I have been trying various combinations of
xsl:value-of, CDATA and the quotes - '' and "" without much success.

Can you help?

Rgds,
sanjeev pai



=====
---------------------------------------------------------
                !!!Have a nice day!!!
---------------------------------------------------------

__________________________________________________
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.