Re: Is there a way to define groups of templates ?

Subject: Re: Is there a way to define groups of templates ?
From: "Oren Ben-Kiki" <oren@xxxxxxxxxxxxx>
Date: Thu, 17 Sep 1998 16:41:16 +0200
> Henry S. Thompson wrote:
> > Eran Pe'er wrote:
> [using named groups of templates]
>
> There will almost certainly be something like this in the next version
> of the working draft.


Is there any idea - even a preliminary one - as to what form it would take?

Here's a suggestion which requires just a minor change to the draft, is very
powerful, and is easy to implement:

- Allow a context attribute in the processing commands. For example,
<xsl:process-children context="toc">

- Allow suffixing a tag name in a pattern with a context. For example,
<xsl:template match="book@toc//chapter"> would match a chapter node which
has a book node as an ancestor, but only inside a process command _in a rule
matching that book node_ which specified the "toc" context.

- Allow specifying just the context, without a tag, in a pattern. For
example: match="@toc//chapter" would match a chapter node, but only inside
_any_ process command which specified the "toc" context.

I suspect such a feature would reduce the need for other advanced features.
For example, the "select" functionality could be implemented using a context
and a separate rule.

BTW, we're now evaluating XSL as a technology to do (rather complex)
transformations of some data structures to HTML. The lack of a feature of
this type has been really crippling for us, to the point we almost rejected
the use of XSL. We're very happy to hear that something to this effect will
be included in the next draft.

Share & Enjoy,

    Oren Ben-Kiki


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread