xsl-list
[Top] [All Lists]

Re: possible to use copy-of without namespace

2003-01-08 06:14:59
At 2003-01-08 11:38 +0100, Thomas Brand wrote:
the template mode=".." is exactly what I was looking for
...
i'll have to read about templates with mode attributes, never saw them.

I tell my students to just think of the mode attribute values as names of collections of template rules. You need to name the collection you want applied when you use <xsl:apply-templates> and you need to name which collection a template rule is in when you declare <xsl:template>.

Up until now you've been using the unnamed collection of template rules, and now you know how you can create named collections of template rules.

Think of the utility of this when you have to do, say, three passes on data to produce a book: one for the table of contents, another one for the body, and yet another one for the index. If it was only possible to have one set of template rules, the logic inside would be horrendous trying to determine what state you were in. Instead, one creates three collections of template rules (one of which may be unnamed) and you just, in turn, use each of the collections.

Quite powerful.

I hope this helps the understanding.

............................ Ken


--
Upcoming hands-on in-depth    North America:  February  3- 7,2003
XSLT/XPath and XSL-FO         Europe:         February 17-21,2003

G. Ken Holman                mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.         http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                      Definitive XSLT and XPath
ISBN 0-13-140374-5                              Definitive XSL-FO
ISBN 1-894049-08-X  Practical Transformation Using XSLT and XPath
ISBN 1-894049-10-1              Practical Formatting Using XSL-FO
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc


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



<Prev in Thread] Current Thread [Next in Thread>