Re: [xsl] concatenation of sibling names

Subject: Re: [xsl] concatenation of sibling names
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Tue, 12 Feb 2002 15:56:17 -0500
[Saverio Perugini]
> Yes, both solutions presented so far on the list are fine, but as
> I said in my original post I am interested in storing the results
> of the concatenation in a parameter to use later in an XPath expression
> [as opossed to just simply outputting it].
> Is that feasible with <xsl:param>?

Well, you can assign the results to a (probably global) variable, and use
its value as the value of a parameter.  But whether you can use it in an
xpath expression depends on the expression.  The result is a string, not a
node-set, and cannot be made into a nodeset (unless you embed it in an
element and then use a processor-dependent RTF-nodeset conversion).
Equality tests for a node name or node content are unlikely to match it.
So it's not clear to me how you will make use of it.

It would help if you explain what you want to accomplish.  For what it's
worth, you can store and use the beast this way:

<xsl:variable name='element-name-list'>
<!-- Code to produce the list goes here -->

<!-- Later, within a template, you could use this:-->
<xsl:apply-templates select='something-or-other'>
    <xsl:with-param name='element-names'

<!-- Finally, within the xsl:called or xsl:applied template:-->
<xsl:template match='something-or-other'>
    <xsl:param name='elements-names'/>
   <!-- Do whatever it is you want to do -->

You will have to adjust the code to work in the definition of the variable.


Tom P

 XSL-List info and archive:

Current Thread