Subject: Re: [xsl] Convert a node-set to a string From: Michael Kay <mike@xxxxxxxxxxxx> Date: Fri, 25 Mar 2011 19:30:56 +0000 |
Is it possible to get a string from a node-set in XSLT 1.1?XSLT 1.1 was a working draft issued around 2001 and withdrawn soon after. Unfortunately during that short period the second edition of my book was published, and many people are still using it, so I suspect that's where you got the name from. But asking a question about a short-lived working draft from 10 years ago isn't helpful.
Michael Kay Saxonica
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Convert a node-set to a s, David Frey | Thread | [xsl] [ANN] Saxon-CE - XSLT 2.0 on , Michael Kay |
Re: [xsl] Convert a node-set to a s, David Frey | Date | Re: [xsl] Convert a node-set to a s, Brandon Ibach |
Month |