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

RE: Newbie question on Recusrion using XLST 1.0

Subject: RE: Newbie question on Recusrion using XLST 1.0
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 30 Apr 2005 14:12:53 +0100
RE:  Newbie question on Recusrion using XLST 1.0
>        I have an example file with the following structure:
> 
> <company>
>    <division DID="Sal">
>       <employees>
> 		<employee EID="EMP001">
> 
> Here is my code so far
> 
> <xsl:variable name="result">
>   <xsl:call-template name="DisplayEmployees">
> 	<xsl:with-param name="employeeList" select="company/division"/>
>   </xsl:call-template>
> </xsl:variable>	
> <xsl:value-of select="$result"/>

The fact that you are using the select expression company/division suggests
that at the point where this variable is declared, the context node is the
root node of the document. (Perhaps it's even a global variable, who knows?)
However, in the code below, you test		

> 	<xsl:when test="employees/employee[@EID]">

without having changed the context node. If company/division selects
anything, then employees/employee won't. I suspect you meant to write
$employeeList/employees/employee - but I haven't checked whether that would
fix the problem.

Michael Kay
http://www.saxonica.com/

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.