[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem with xsl:template using XSLT 1.0
> I kind of understand what Scott means but I'm not sure I agree - in > the above example doesn't the template match pattern in the latter > method give you same level of context as the select in the former? I think that what Scott was refering to is (for example) relying on context such as the current node. <xsl:apply-templates select="some-nodes[some-filter]"/> <xsl:template>.... and <xsl:apply-templates select="some-nodes"/> <xsl:apply-templates/> <xsl:template match="some-nodes"/> <xsl:template match="some-nodes[some-filter]">.... may be sort of equivalent (modulo use of position() ) if some-filter is fixed, but often it depends on a local xpath <xsl:apply-templates select="some-nodes[@id=current()/@id]"/> for example can't so easily be moved down on to the match. Looking down my stylesheets I seem to use both ways (and for-each (and more and more, for-each-group) in about equal measure. 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
|