[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

Subject: Re: Problem with xsl:template using XSLT 1.0
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 4 Dec 2007 11:31:44 GMT
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. 
________________________________________________________________________

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.