xsl-list
[Top] [All Lists]

Re: [xsl] Problem with xsl:template using XSLT 1.0

2007-12-04 04:32:18


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[(_at_)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. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--