This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xsl:template node set parameter


>Can I pass a set of nodes as a parameter to a template?

Yes, but "node sets" in XSLT terminology are sets of nodes from the source
document, not sets of nodes that you generate within the stylesheet.  You
can make a parameter or variable take a node set as a value by setting that
value with the 'select' attribute.

When you set a parameter or variable value using the content of the
parameter or variable, then you create a "result tree fragment", which is
exactly what it says on the tin - a fragment of the result tree.  Result
tree fragments aren't the same as source nodes, and you can do only limited
things with them.  One of the things that you *can't* do is process them in
any way.

Some processors have extension functions that allow you to convert result
tree fragments into node sets.  I'm not sure if Xalan has one or how to use
it, but I'm sure someone else does.

Without using an extension function, you may have to do two passes: one
pass creating a result that you then use as the input to the next pass.
But you haven't given enough details of your actual problem to tell whether
this is necessary.

Sorry not to be more help,

Jeni

Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]