XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Frans EnglichSubject: Passing context with call-template select
Author: Frans Englich
Date: 13 Sep 2004 05:25 PM

Hello all,

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?


Thanks in advance,

Frans


Postnext
Minollo I.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].

Hope this helps,
Minollo

Postnext
Frans EnglichSubject: Re: Passing context with call-template select
Author: Frans Englich
Date: 13 Sep 2004 05:54 PM

I think you got the examples wrong!

(at least it's empty for me)


Cheers,

Frans

Posttop
Minollo I.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].


Hope this helps,
Minollo

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.