Hi, Malathi.

Sorry that I didn't notice this problem earlier.  The name of the 
Xalan-specific extension function is xalan:nodeset rather than 
xalan:node-set.  I believe that's why you're getting the 
NoSuchMethodException.  The following should work:

<xsl:for-each select="xalan:nodeset($grps)/Groups/Group"> 

Alternatively, for greatest portability, you might want to use the EXSLT 
common node-set extension function:

<xsl:for-each select="common:node-set($grps)/Groups/Group" 
xmlns:common="http://exslt.org/common";> 

I hope that helps.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro
XML Transformation & Query Development
IBM Toronto Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]



"Manivannan, Malathi" <[EMAIL PROTECTED]> 
2008-05-07 12:05 PM

To
Henry Zongaro/Toronto/[EMAIL PROTECTED], Brian Minchau/Toronto/[EMAIL PROTECTED]
cc
<xalan-j-users@xml.apache.org>, "Muthiyan, Chittu" 
<[EMAIL PROTECTED]>, "Java Girl" <[EMAIL PROTECTED]>
Subject
RE: Xalan 2.7.1 class cast problem.






Brian/Henry – Any updates on this issue? We are stuck here as our 
Application is planning to upgrade our Selectica Engine to 9.1, which has 
Xalan 2.5. With Xalan 2.5, we were getting the error “Can not convert 
#RTREEFRAG to a NodeList!” – so we tried moving to Xalan 2.7.1 – hence 
then the below mentioned errors. Any help in this regard will be greatly 
appreciated.
 
Thanks,
 
Malathi Manivannan
E-Configurator group
Tellabs, Naperville IL.
[EMAIL PROTECTED]
(630) 798-4072

From: Manivannan, Malathi 
Sent: Monday, May 05, 2008 1:38 PM
To: 'Henry Zongaro'; Brian Minchau
Cc: xalan-j-users@xml.apache.org; Muthiyan, Chittu; 'Java Girl'
Subject: RE: Xalan 2.7.1 class cast problem.
 
Hi Henry - 
 
The grps variable is result tree fragment – with multiple “Group” nodes 
that I wan to traverse. Please see the attached xml –$grps refers to the 
<RightNav> tree fragment. This was working until we decided to upgrade 
Xalan (and also moved from JDK 1.4.2 to 1.5 )
 
I did try the change you suggested below, now I am getting the following 
error.
 
org.apache.xml.utils.WrappedRuntimeException: 
java.lang.NoSuchMethodException: For extension function, could not find 
method org.apache.xalan.lib.Extensions.nodeSet([ExpressionContext,] 
#STRING).
Checked both static and instance methods.
 
Thanks,
 
Malathi Manivannan
E-Configurator group
Tellabs, Naperville IL.
[EMAIL PROTECTED]
(630) 798-4072

----- Original Message ----
From: Henry Zongaro <[EMAIL PROTECTED]>
To: Java Girl <[EMAIL PROTECTED]>
Cc: xalan-j-users@xml.apache.org; Brian Minchau <[EMAIL PROTECTED]>
Sent: Monday, May 5, 2008 11:58:51 AM
Subject: Fw: Xalan 2.7.1 class cast problem.


Hi, Malathi. 

What does the definition of the grps variable look like?   The usual 
reason for this sort of error is that a result-tree fragment is being used 
in a context where a node set was expected.  That's not permitted 
according to section 11.1 of XSLT 1.0,[1] so an operation like 
$grps/Groups/Group would not be permitted if the value of grps was a 
result-tree fragment. 

The node-set extension function allows you to tree a result-tree fragment 
as a node set, but in your example, you've made the argument to node-set 
be the result of the path expression, instead of applying it to the value 
of grps itself. 

Try changing this 

<xsl:for-each select="xalan:node-set($grps/Groups/Group)"> 

to this 

<xsl:for-each select="xalan:node-set($grps)/Groups/Group"> 

I hope that helps. 

Thanks,

Henry 
[1] http://www.w3.org/TR/xslt#section-Result-Tree-Fragments
------------------------------------------------------------------
Henry Zongaro
XML Transformation & Query Development
IBM Toronto Lab   T/L 313-6044;  Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]
From: Java Girl [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 05, 2008 12:04 PM
To: Brian Minchau
Cc: xalan-j-users@xml.apache.org; Manivannan, Malathi; Muthiyan, Chittu
Subject: Re: Xalan 2.7.1 class cast problem.
 
Hi Brian - I have tried both - the Xalan interpreter and XSLTC(with 
recomplied Stylesheet)..Still getting the same error..
 
~Latha (a) Malathi
 
----- Original Message ----
From: Brian Minchau <[EMAIL PROTECTED]>
To: Java Girl <[EMAIL PROTECTED]>
Cc: xalan-j-users@xml.apache.org
Sent: Monday, May 5, 2008 11:29:04 AM
Subject: Xalan 2.7.1 class cast problem.
Hi Latha.
Looking at the class hierarchy, it does indeed look as though XNodeSet 
extends NodeSequence which extends XObject.

XString extends XObject. So for 2.7.1 this casting is never right. Are you 
running the Xalan interpreter, or XSLTC? If XSLTC, did you recompile your 
stylesheet?

- Brian

Java Girl <[EMAIL PROTECTED]>

Java Girl <[EMAIL PROTECTED]> 
05/02/2008 02:49 PM



To

[EMAIL PROTECTED]

cc

Latha Mani <[EMAIL PROTECTED]>

Subject

Fw: XSLT 1.0
 






Brian - Would you be able to help me with this?

I just upgraded from Xalan 2.4.1 to Xalan 2.7.1. Now I am getting "
java.lang.ClassCastException: org.apache.xpath.objects.XString cannot be 
cast to org.apache.xpath.objects.XNodeSet " in the below line - I love the 
way the error points to the exact line number of the xslt :)

I tried converting my xslt from 

<xsl:for-each select="$grps/Groups/Group"> 
to 
<xsl:for-each select="xalan:node-set($grps/Groups/Group)"> 
But I still get the same error. Any suggestions? 
Thanks, 
~Malathi

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it 
now.

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it 
now.
 

Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it 
now.
============================================================
The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader
of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any reproduction,
dissemination or distribution of this communication is strictly
prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and
deleting it from your computer. Thank you. Tellabs
============================================================


Reply via email to