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

Re: matching question

Subject: Re: matching question
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 06 Aug 2008 13:37:07 +0200
Re:  matching question
Garvin Riensche wrote:
Thanks for your answer. So, if my stylesheet only consists of one template without an apply-templates:

<xsl:template match="node()">
...
</xsl:template>

I guess there's a build-in template with a call of apply-templates so that this template is executed.

If my input is like

<a>
  <b/>
</a>

the above template matches only <a> although <b> is also a node that is "children of some parent". What's the reason for that?

The built-in template for the root nodes looks like this
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
see http://www.w3.org/TR/xslt#built-in-rule so it processes all child nodes (which in your sample document is the 'a' element).
The a matching template for the 'a' element is used which is your template above where you omitted the template body. If that does <xsl:apply-templates/> respectively <xsl:apply-templates select="node()"/> or <xsl:apply-templates select="*"/> then the 'b' element is processed too.


--

	Martin Honnen
	http://JavaScript.FAQTs.com/

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.