Subject: [xsl] Re: xsl-list Digest 23 Jan 2006 06:10:00 -0000 Issue 668 From: Phillip B Oldham <phillip.oldham@xxxxxxxxxx> Date: Thu, 26 Jan 2006 13:24:29 +0000 |
Date: Mon, 23 Jan 2006 01:10:55 +0100 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx From: "mnews-xsl@xxxxxx" <mnews-xsl@xxxxxx> Subject: RE: SQL BTree to XML Tree? Message-ID: <43D41F0F.30407@xxxxxx>
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>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Variable number of argume, Florent Georges | Thread | [xsl] rounding within the "format-n, Osheka, Susan |
[xsl] Variable number of arguments, Florent Georges | Date | RE: [xsl] Variable number of argume, Michael Kay |
Month |