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

How to pass ancestor to a function?

Subject: How to pass ancestor to a function?
From: "Anand A Tarkas , Gurgaon" <atarkas@xxxxxxxxxxxxxxx>
Date: Mon, 24 May 1999 17:31:11 +0530
passing ancestor function
Hi,
i am using IE5 .
i hope somebody is able to solve this problem.

we have a xml which looks like:
<?xsl version="1.0"?>
<Company>
      <Employee empcode="1">
             <Project pcode="p1">
	      <Duration hours="10" />	 
	</Project>
	<Project pcode="p2">
	       <Duration hours="8" />	 
	</Project>
      </Employee	>
      <Employee empcode="2">
             <Project pcode="p1">
	      <Duration hours="14"/>	 
	</Project>
	<Project pcode="p2">
	       <Duration hours="6" />	 
	</Project>
            <Project pcode="p3">
	       <Duration hours="12" />	 
	</Project>
      </Employee	>
</Company>   

Problem:
Does xsl have any way of  passing ancestor  to a function written in
Javascript ?
i have something like this

<xsl:for-each select="Company/Employee/Project">
<xsl:eval> total(this) </xsl:eval> <!-- instead of  "this" i want to pass
the root of the document i.e company.is it possible?-->
</xsl:for-each>


<xsl:script>
	function total(Project)
	{
	     /* is it possible to get the root of the document or any other
ancestor node of what is passed, in this function ?	*/
	}
</xsl:script>

i hope the problem is clear and somebody comes up with its solution.
Thanks in advance.
regards,
anand.


 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.