xsl-list
[Top] [All Lists]

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

2011-03-25 13:57:42
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?




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