Re: Is there a way to define groups of templates ?
> 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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format