xsl-list
[Top] [All Lists]

[xsl] Convert a node-set to a string

2011-03-25 13:00:41
Is it possible to get a string from a node-set in XSLT 1.1?

Say I have some XML like this (completely made up):

<Inventory>
<Item price="10" quantity="7" name="widget"/>
<Item price="4" quantity="3" name="chair"/>
</Inventory>


And then I define a template like this:

<xsl:template match="Item">
<xsl:variable name="item" select="."/>
<xsl:variable name="len" select="ext:someExtensionFunction($item)"/>
<Length><xsl:value-of select="$len"/></Length>
</xsl:template>

The problem I think I am having is that my extension function expects a string, but I am passing it a node-set. I want to convert the node-set to a string rather than changing the extension function to accept a node-set as a parameter. Is this possible?

Thanks,
Dave

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

<Prev in Thread] Current Thread [Next in Thread>