RE: Problem passing node-set to params (RTF)
The error message I'm getting is: "XSLT 1.0 Debugging Error: Expression did not evaluate to a node-set" I'm using XMLSpy to debug my XSLT, but I'm running my XSL under Java's XSLT parser which I guess is the Apache XSLT. I'm running java version 1.4.2_04. The error I'm getting is from XMLSpy. The definition of local is: <xsl:variable name="local" select="../member[@component=$localComponent]"/> And the definition of localComponent is: <xsl:variable localComponent select = '1' /> Here is the error I get from Java: org.apache.xpath.XPathException: Can not convert #STRING to a NodeList! local and current() are both showing Node-Set in the debugger. It's only after I assign then to parameters using with-param that they become RTFs. Oddly enough the guid and agent are shown as node-sets for attributes, but the other don't. I don't know what the problem is. Thanks Charlie Date: Wed, 17 Nov 2004 04:47:26 -0000 To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> From: "Michael Kay" <mike@xxxxxxxxxxxx> Subject: RE: Problem passing node-set to params (RTF) Message-ID: <S-UTL01-DCPOPPkLbg70001d508@xxxxxxxxxxxxxxxxxxx> Nothing in the code you have shown us is creating a result tree fragment, though it's possible that $local is an RTF, since you haven't shown us its declaration. > After reading the FAQ it said > that assigning existing variables to parameters turns > them into RTF. But, when I tried replacing them with > expressions rather than $var it still ended up a RTF. I'm tempted to ask what the FAQ said before you read it... Seriously though, you must have misread it. RTFs are created only by an xsl:variable, xsl:param, or xsl:with-param element that has child instructions rather than a select attribute. Also, what exactly was the error message? It's better to quote it literally, especially if you don't fully understand it. Michael Kay http://www.saxonica.com/ __________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format