xsl-list
[Top] [All Lists]

Re: xsl-list Digest 23 Jan 2006 06:10:00 -0000 Issue 668

2006-01-26 06:24:29
Hi.

I've given this a go, but the context its being used in is causing problems.

Is there any way I can convert this so that I use <xsl:call-template /> instead of <xsl:apply-templates />? I've tried to convert it, but I just get 500 errors from the web-server (this is being processed by PHP5).

Thanks.

Date: Mon, 23 Jan 2006 01:10:55 +0100
To:  xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
From: "mnews-xsl(_at_)gmx(_dot_)de" <mnews-xsl(_at_)gmx(_dot_)de>
Subject: RE: SQL BTree to XML Tree?
Message-ID: <43D41F0F(_dot_)30407(_at_)gmx(_dot_)de>

Hello,

the following is intended to work in XSLT 1.0 (libxslt):
It's a recursive template, hopefully not to wastefull on the ressources.

<?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>
  • Re: xsl-list Digest 23 Jan 2006 06:10:00 -0000 Issue 668, Phillip B Oldham <=