Re: [xsl] Convert a node-set to a string

Subject: Re: [xsl] Convert a node-set to a string
From: David Frey <dpfrey@xxxxxxx>
Date: Fri, 25 Mar 2011 11:57:33 -0700
I don't think this will work. I believe string(.) will return the empty string because the node I pass it has no text nodes. This is consistent with my testing. Please correct me if I am missing something.


On 11-03-25 11:29 AM, Wendell Piez wrote:
David,

Try this:

<xsl:template match="Item">
<Length>
<xsl:value-of select="ext:someExtensionFunction(string(.))"/>
</Length>
</xsl:template>

Cheers,
Wendell

On 3/25/2011 2:00 PM, David Frey wrote:
<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?

Current Thread