Subject: Re: ClassCastException
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 11 Dec 2003 11:52:32 GMT
|
line 17 (mentioned in teh error) is
<xsl:for-each select="$node[1]/ancestor-or-self::*">
that expression will only be valid if the variable $node contains a node set
but you are calling it as:
<xsl:call-template name="node:xpath">
<xsl:with-param name="node" >
<xsl:value-of select="$nodew"/>
</xsl:with-param>
</xsl:call-template>
so teh parameter will never be a node set it will be a result tree
fragment corresponding to a root node with a single text node child with
value teh string value of the parameter nodew.
Most of the parameters are unused so you could change that to
<xsl:template name="getvalue2" >
<xsl:param name="nodew"/>
<xsl:call-template name="node:xpath">
<xsl:with-param name="node"select="$nodew"/>
</xsl:call-template>
But nodew is not a node either, depite its name. It is aanother result
tree fragment with a string value that looks like an xpath but is not a
path to the system, its just a string.
<xsl:with-param name="nodew">
/DATA/component/<xsl:value-of select="$reqnode"/>
</xsl:with-param>
You probably want
<xsl:with-param name="nodew" select="/DATA/component/*[name()=$reqnode]"/>
so that your parameter does contain a node set, although then this will
always be a set of element nodes, so most of the testing in the
node:xpath template is a no-op.
David
--
http://www.dcarlisle.demon.co.uk/matthew
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- ClassCastException
- alana - Thu, 11 Dec 2003 06:09:33 -0500 (EST)
- David Carlisle - Thu, 11 Dec 2003 06:53:40 -0500 (EST) <=
- Michael Kay - Fri, 12 Dec 2003 06:27:20 -0500 (EST)
- <Possible follow-ups>
- alana - Fri, 12 Dec 2003 00:41:15 -0500 (EST)
- David Carlisle - Fri, 12 Dec 2003 17:01:35 -0500 (EST)
- JCS - Fri, 12 Dec 2003 17:34:34 -0500 (EST)
|
|