Re: matching question
If my input is like > <a> > <b/> > </a> > > the above template matches only <a> No it also matches b. The template will only be activated with b as the current node if templates are applied to b. initially the current node is the root of the document (/) your template that matches child::node() does not match / as that is not the child of anything so the default template is used, which does <xsl:apply-templates select="node()"/> this selects the children of a which is the a element in your example. your template matches a so will fire. What happens next depends on what you puit in the ... > <xsl:template match="node()"> > ... > </xsl:template> If you don't apply-templates then that is the end of processing. if you do apply templates eg have again <xsl:apply-templates select="node()"/> or equivalently just <xsl:apply-templates/> then templates will be applied to teh children of a which consists of two white space text nodes and a b element. Your template matching node() would match all three of those nodes so would be fired a further three times. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
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