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]
Other format: [Raw text]

Re: concatenation of sibling names


[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 -->
</xsl:variable>

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

<!-- 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 -->
</xsl:template>

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

Cheers,

Tom P


 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]