xsl-list
[Top] [All Lists]

Re: [xsl] passing param using value-of

2012-02-16 17:04:04
This works fine.

 <xsl:call-template name="myTemplate">
        <xsl:with-param name="arguments" select="preceding-sibling::*">
        </xsl:with-param>
</xsl:call-template>

But this doesn't:

<xsl:call-template name="myTemplate">
        <xsl:with-param name="arguments">
             <xsl:value-of select="preceding-sibling::*" />
        </xsl:with-param>
 </xsl:call-template>

Why ? How do I use value-of to set the value of a parameter ?


xsl:value-of generates a (single) text node. Depending on the parameter,
that may be okay (or maybe not), even if the cases when a text node is good
but a simple string is not even better are fairly rare.

Don't forget in the 2nd option that it's a text node child of a
document node, whereas in the first option (using select) it's
sequence type is element()*  (i think)

-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--