xsl-list
[Top] [All Lists]

Convert apply-templates to call-template?

2006-01-30 01:11:34
Hi all

Someone kindly gave me the following stylesheet to reproduce a SQL BTree in XML nodes. I'm 
having a problem, however, and need to convert the template to act on <xsl:call-template 
/> rather than <xsl:apply-templates />. Can someone help me convert it? I've 
tried, but I just end up with 500 errors from PHP5.

:::::

<?xml version="1.0" encoding="utf8"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="xml" encoding="utf8" indent="yes"/>

<!-- Conditions equivalent to
   <xsl:sequence select="$boss/../item[lh gt $boss/lh and rh le $boss/rh]"/>
-->

<xsl:template match="item">
   <xsl:param name="context"/>
   <xsl:if test="not($context[current()/lh > lh and rh >= current()/rh])">
     <xsl:variable name="context-inner"
       select="$context[lh > current()/lh and current()/rh >= rh]"/>
     <department title="{name}">
       <xsl:apply-templates select="$context-inner">
         <xsl:with-param name="context" select="$context-inner"/>
       </xsl:apply-templates>
     </department>
   </xsl:if>
</xsl:template>

<xsl:template match="/">
   <group>
     <xsl:apply-templates select="output/item">
       <xsl:with-param name="context" select="output/item"/>
     </xsl:apply-templates>
   </group>
</xsl:template>

</xsl:stylesheet>


--~------------------------------------------------------------------
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>