[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] toc with number with element selection

Subject: Re: [xsl] toc with number with element selection
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxx>
Date: Thu, 27 Feb 2014 14:09:18 -0500

Dear Jean-Francois,

Try something like this:

<xsl:variable name="filtered">
  <xsl:apply-templates select="/" mode="filter"/>

Then you apply templates select="$filtered" to process the $filtered
temporary tree in place of the source document.

Take care when you do so that you do not match its root node with a
template that puts you into an eternal loop! You can avoid this by
using another mode or by seeing to it that the temporary tree has no
root node (use as="element()" on the variable declaration).

I hope this helps; ask again if this is too cryptic. This is a
powerful technique with many applications.

Cheers, Wendell

On Thu, Feb 27, 2014 at 11:15 AM, jfrm.maurel@xxxxxxxxx
<jfrm.maurel@xxxxxxxxx> wrote:
> Le 27/02/2014 15:51, Wendell Piez a C)crit :
> Hi Wendell,
>> Let us know if you need any more hints.
> Thank you very much for your helpful answer.
> In the mean time I exprimented on the 2 solutions you suggest.
> I succeded in copying the tree except pdf='no' element and numbering in a
> second stylesheet but I am not sure how to execute this in one stylesheet.
> Regards
> --
> Jean-FranC'ois MAUREL
> http://www.pimeca.com

Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables

Current Thread