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

applying templates to all descendants

Subject: applying templates to all descendants
From: Adam Van Den Hoven <Adam.Hoven@xxxxxxxxxxxx>
Date: Wed, 10 Jan 2001 10:57:44 -0800
book templates
Lets say that I have the following XML (borrowed from MS)
<COLLECTION>
  <BOOK>
    <TITLE>Cosmos</TITLE>
    <AUTHOR>Carl Sagan</AUTHOR>
    <PUBLISHER>Ballantine Books</PUBLISHER>
  </BOOK>
  <BOOK>
    <TITLE>Catwings</TITLE>
    <AUTHOR>Ursula K. Le Guin</AUTHOR>
    <PUBLISHER>Scholastic</PUBLISHER>
  </BOOK>
  <BOOK>
    <TITLE>Home Town</TITLE>
    <AUTHOR>Tracy Kidder</AUTHOR>
    <PUBLISHER>Random House</PUBLISHER>
  </BOOK>
</COLLECTION>
and an XSL file that contains:
<xsl:template match="/" >
	...STUFF...
	<xsl:apply-templates select="/COLLECTION//*" />
	...STUFF...
</xsl:template>
<xsl:template select="BOOK">
	...STUFF...
	<xsl:apply-templates select="*" />
	...STUFF...
</xsl:template>
<xsl:template select="TITLE">
	...STUFF...
</xsl:template>

will the TITLE template get executed in the context of the root template AND
the BOOK template or just the BOOK template. That is, having matched a node
to a template, will apply-templates continue to make matches to its
descendants. 
I suppose I could avoid complication by making use of modes (and I will do
that regardless), I'm really interested in knowing what the behaviour is. 

> 		Adam van den Hoven
> 		Internet Application Developer
> 		Blue Zone
> 		tel. 604.685.4310
> 		fax. 604.685.4391
> 
> Blue Zone makes you interactive. http://www.bluezone.net/
> 
> 
> 
> 

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


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.