xsl-list
[Top] [All Lists]

RE: Newbie question on Recusrion using XLST 1.0

2005-04-30 06:12:53
       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[(_at_)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/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>