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


> <xsl:template match="db/*">
>     <xsl:for-each select="previous-sibling::*">
>         <xsl:value-of select="name()"/>
>         <xsl:text> </xsl:text>
>     </xsl:for-each>
>     <xsl:for-each select="following-sibling::*">
>         <xsl:value-of select="name()"/>
>         <xsl:text> </xsl:text>
>     </xsl:for-each>
> </xsl:template>


> 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>?

<xsl:template match="db/*">
    <xsl:param name="param">
        <xsl:for-each select="previous-sibling::* | following-sibling::*">
            <xsl:value-of select="concat(name(),' ')"/>
        </xsl:for-each>
    </xsl:param>
    <xsl:value-of select="$param"/>
</xsl:template>


 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]