[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL Dominos

Subject: Re: XSL Dominos
From: Liam R E Quin <liam@xxxxxx>
Date: Fri, 28 May 2010 21:43:06 -0400
Re:  XSL Dominos
On Fri, 2010-05-28 at 15:09 +0100, Nick Leaton wrote:

> On the apply templates versus call, I've never been able to get my
> head round the apply-templates bit, particular because of the need to
> use a mode. I personally read apply-templates as, "something happens
> here, but I don't know what" !!

When the XSLT processor sees apply-templates, conceptually, this is
what happens:
(1) it makes a list of all the child nodes (elements & text) of the
    current element; you can override this using the select= attribute
    to apply-templates.

(2) for each child node, xsl:apply-templates looks for the best
    template that matches that node, and uses it.
    You can restrict the search of templates to ones that have a
    particular "mode" attribute value.
    If none of the templates you have written match a particular node,
    a built-in default template is used.

(3) the results of those templates are joined together and replace the
    "xsl:apply-templates" instruction in the current template.

This is the single most important thing to understand about XSLT. Or,
at least, I think it is :)

Note, there are some additional complexities e.g. to do with importing
stylesheets and to do with priority and precedence, so this isn't a
complete picture, but it is enough for understanding what happnens most
of time.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.