I have 10 "bar" elements in the document element "foo". In my
XSLT sheet I have a template for formatting, which various
templates (is supposed to) call, with somehow as argument the
elements they want to be formatted, via some form of XPath/select
mechanism.
My idea is this, which what I understand doesn't, and should not, work:
<xsl:call-template name="formattingTemplate" select="//bar[my='selection']"/>
Since call-template doesn't have @select.
But how do I solve my problem -- how do I make a template operate
on a set of elements I choose? Do I have to pass an param/variable containing
the selected nodes?
Subject:Re: Passing context with call-template select Author:Minollo I. Date:13 Sep 2004 06:11 PM Originally Posted: 13 Sep 2004 05:41 PM
If I well understand what you are trying to do, you just need to use a:
...and then have a...
...
...take care of outputting "bar" the way you like. The template matched on
"bar" will be triggered for all occurrences of the "bar" element in the
nodeset identified by //bar[my='selection].
Subject:Re: Passing context with call-template select Author:Minollo I. Date:13 Sep 2004 06:11 PM
Second try:
If I well understand what you are trying to do, you just need to use a:
<xsl:apply-templates select="//bar[my='selection']"/>
...and then have a...
<xsl:template match="bar">
...
</xsl:template>
...take care of outputting "bar" the way you like. The template matched on
"bar" will be triggered for all occurrences of the "bar" element in the
nodeset identified by //bar[my='selection].