xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henry Zongaro <zong...@ca.ibm.com>
Subject Re: RunTimeException with xsl:variable ( bug ? )
Date Tue, 08 Feb 2005 14:00:24 GMT
Hi, Marco.

"Marco Laponder" <mlr@interchain.nl> wrote on 2005-02-08 02:13:14 AM:
> I have the following part in my xsl file:
> 
> <xsl:variable name="screeninfo" >
>         <info2>
>                 <test/>
>         </info2>
> </xsl:variable>
> 
> <xsl:copy-of select="$screeninfo/info2"/> 
> 
> This gives me the following error, it looks like a bug, or am I 
> doing something 
> weird in my xsl file ?
> 
> java.lang.RuntimeException: org.apache.xpath.objects.XRTreeFrag

     The value of the variable "screeninfo" is a result-tree fragment. 
XSLT 1.0 does not permit path expressions to begin with a variable whose 
value is a result-tree fragment.  According to section 11.1 of XSLT 
1.0:[1]

   the operations permitted on a result tree fragment are a subset
   of those permitted on a node-set. An operation is permitted on
   a result tree fragment only if that operation would be
   permitted on a string (the operation on the string may involve
   first converting the string to a number or boolean). In
   particular, it is not permitted to use the /, //, and []
   operators on result tree fragments.

     You can use the EXSLT node-set function[2] to work around this 
limitation.

     The message in the exception is not particularly helpful.

Thanks,

Henry
[1] http://www.w3.org/TR/xslt#section-Result-Tree-Fragments
[2] http://xml.apache.org/xalan-j/extensionslib.html#nodeset
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


Mime
View raw message