Re: Stylesheet assistance

Subject: Re: Stylesheet assistance
From: Gary L Peskin <garyp@xxxxxxxxxxxx>
Date: Tue, 25 Jul 2000 16:48:44 -0700
Daniel --

A much briefer version with two simple templates and no parameter
passing.  Many thanks to Nikolai Grigoriev for inspiration regarding the
ancestor:: axis.


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
<xsl:output method="html" indent="yes" />
<xsl:strip-space elements="test"/>

<xsl:template match="test">

<xsl:template match="p">
  <xsl:param name="indent" select="0"/>
  <xsl:variable name="indent" select="count(ancestor::*[ancestor::*/b])
* 12" />
	<xsl:when test="$indent = 0">
	  <p><xsl:value-of select="."/></p>
	  <p style="{concat('margin-left: ',$indent, 'px')}"><xsl:value-of


Gary L Peskin wrote:
> Daniel --
> Well, it's ugly but it does seem to do what you want.  Maybe someone can
> come up with a more abbreviated version.
> ...

 XSL-List info and archive:

Current Thread