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

Convert apply-templates to call-template?

Subject: Convert apply-templates to call-template?
From: Phillip B Oldham <phillip.oldham@xxxxxxxxxx>
Date: Mon, 30 Jan 2006 08:11:34 +0000
xsl apply templates call template
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>

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.