You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Julien Le Dem <ju...@thet-is.com> on 2003/11/10 14:34:50 UTC

Xpath query in xindice 1.1b1

<problem>
When sending an xpath request using a function (like count(...) ) I have an
exception.
</problem>
<Context>
package org.apache.xindice.core.query
class XPathQueryResolver
<snip line="539">
      private Object evalFunction(String owner, int pos) throws Exception {
         int idx = cmp.getFirstChildPos(pos);
         int id = cmp.getOp(idx);
         int endFunc = pos + cmp.getOpMap()[pos+1] - 1;
</snip>
the last line throws a NoSuchMethodError.
after looking the Xalan javadoc getOpMap() doesn't return an array.
I looked into CVS the current version and the code has changed (a bug fix ?)
so it shouldn't throw an exception anymore (but I haven't tested it)
I use xindice in embeded mode.
</context>
<question>
What should I do ?
1) Do I use the wrong Xalan version ? Xindice 1.1b1 should use an older
version and I have to use endorse something ?
2) Do I have to update my Xindice library to the actual CVS ?
</question>
thanks Julien

Re: Xpath query in xindice 1.1b1

Posted by Julien Le Dem <ju...@thet-is.com>.
Thank you,
So the problem comes from the JDK 1.4.2 that has its own version of the
parser in it and I should endorse something to have it working (the version
of Xalan distributed with Xindice 1.1b1 is 2.4.0).
I looked in the Xalan 2.4.0 source code and the method returns an Array !!!
So you're completely right :-) .
Is there another way than endorsing ? Because I use Xindice embeded and I
have other parts of my app that parse XML... Of course I can upgrade to the
CVS version...
Julien
----- Original Message ----- 
From: "Terry Rosenbaum" <Te...@amicas.com>
To: <xi...@xml.apache.org>
Sent: Monday, November 10, 2003 6:15 PM
Subject: Re: Xpath query in xindice 1.1b1


> Nothing broken. Ensure that you use the correct
> version of Xalan depending on the version of
> Xindice you're using. Use late-model versions
> of Xalan with late-model versions of Xindice
> and you'll see it work OK.
>
> The Xalan API changed and the Xindice code
> was changed to match that change.
>
> I use the latest CVS code for Xindice and
> use Xalan 2.5.D1 and it works for me.
>
> -Terry
>
> Julien Le Dem wrote:
>
> >So this is a bug in 1.1B1 (I mean, there's no way to have this working in
> >1.1b1)
> >A question that maybe of no use :
> >If the method was returning an array before, why Xalan dev don't leave it
> >with a @deprecated info ? I know it's ugly, but it prevents other
projects
> >(like Xindice) to have bug in it.
> >Lazy me that wanted to use a pre-packaged jar ... I will have to build it
> >from CVS... :°-(
> >Is there any stability issue in CVS version that wasn't in the 1.1b1
> >"Milestone Release"?
> >I'm using very basic (but great ! don't be alarmed devs! ;-)
> >functionnalities like adding/replacing documents in collections and
> >performing XPath requests.
> >Thanks, Julien
> >----- Original Message ----- 
> >From: "JC Tchitchiama" <jc...@panonet.net>
> >To: <xi...@xml.apache.org>; "Julien Le Dem"
> ><ju...@thet-is.com>
> >Sent: Monday, November 10, 2003 3:44 PM
> >Subject: Re: Xpath query in xindice 1.1b1
> >
> >
> >Hi Julien,
> >
> >When I came accross the problem I just decided to use the CVS version
> >which has something lile
> >
> >...
> >code snippet
> >      private Object evalFunction(String owner, int pos) throws Exception
{
> >         int idx = Compiler.getFirstChildPos(pos);
> >         int id = cmp.getOp(idx);
> >         int endFunc = cmp.getOp(pos +1) - 1;
> >
> >         List args = new ArrayList();
> >         int lp = idx+1;
> >         while ( lp < endFunc ) {
> >            args.add(evaluate(owner, lp));
> >            lp = cmp.getNextOpPos(lp);
> >         }
> >...
> >
> >Indeed the XPath Compiler interface has changes
> >
> >On Monday 10 Nov 2003 1:34 pm, Julien Le Dem wrote:
> >
> >
> >><problem>
> >>When sending an xpath request using a function (like count(...) ) I have
> >>
> >>
> >an
> >
> >
> >>exception.
> >></problem>
> >><Context>
> >>package org.apache.xindice.core.query
> >>class XPathQueryResolver
> >><snip line="539">
> >>      private Object evalFunction(String owner, int pos) throws
Exception
> >>
> >>
> >{
> >
> >
> >>         int idx = cmp.getFirstChildPos(pos);
> >>         int id = cmp.getOp(idx);
> >>         int endFunc = pos + cmp.getOpMap()[pos+1] - 1;
> >></snip>
> >>the last line throws a NoSuchMethodError.
> >>after looking the Xalan javadoc getOpMap() doesn't return an array.
> >>I looked into CVS the current version and the code has changed (a bug
fix
> >>?) so it shouldn't throw an exception anymore (but I haven't tested it)
I
> >>use xindice in embeded mode.
> >></context>
> >><question>
> >>What should I do ?
> >>1) Do I use the wrong Xalan version ? Xindice 1.1b1 should use an older
> >>version and I have to use endorse something ?
> >>2) Do I have to update my Xindice library to the actual CVS ?
> >></question>
> >>thanks Julien
> >>
> >>
> >
> >
> >
>
>
>


Re: Xpath query in xindice 1.1b1

Posted by Terry Rosenbaum <Te...@amicas.com>.
Nothing broken. Ensure that you use the correct
version of Xalan depending on the version of
Xindice you're using. Use late-model versions
of Xalan with late-model versions of Xindice
and you'll see it work OK.

The Xalan API changed and the Xindice code
was changed to match that change.

I use the latest CVS code for Xindice and
use Xalan 2.5.D1 and it works for me.

-Terry

Julien Le Dem wrote:

>So this is a bug in 1.1B1 (I mean, there's no way to have this working in
>1.1b1)
>A question that maybe of no use :
>If the method was returning an array before, why Xalan dev don't leave it
>with a @deprecated info ? I know it's ugly, but it prevents other projects
>(like Xindice) to have bug in it.
>Lazy me that wanted to use a pre-packaged jar ... I will have to build it
>from CVS... :°-(
>Is there any stability issue in CVS version that wasn't in the 1.1b1
>"Milestone Release"?
>I'm using very basic (but great ! don't be alarmed devs! ;-)
>functionnalities like adding/replacing documents in collections and
>performing XPath requests.
>Thanks, Julien
>----- Original Message ----- 
>From: "JC Tchitchiama" <jc...@panonet.net>
>To: <xi...@xml.apache.org>; "Julien Le Dem"
><ju...@thet-is.com>
>Sent: Monday, November 10, 2003 3:44 PM
>Subject: Re: Xpath query in xindice 1.1b1
>
>
>Hi Julien,
>
>When I came accross the problem I just decided to use the CVS version
>which has something lile
>
>...
>code snippet
>      private Object evalFunction(String owner, int pos) throws Exception {
>         int idx = Compiler.getFirstChildPos(pos);
>         int id = cmp.getOp(idx);
>         int endFunc = cmp.getOp(pos +1) - 1;
>
>         List args = new ArrayList();
>         int lp = idx+1;
>         while ( lp < endFunc ) {
>            args.add(evaluate(owner, lp));
>            lp = cmp.getNextOpPos(lp);
>         }
>...
>
>Indeed the XPath Compiler interface has changes
>
>On Monday 10 Nov 2003 1:34 pm, Julien Le Dem wrote:
>  
>
>><problem>
>>When sending an xpath request using a function (like count(...) ) I have
>>    
>>
>an
>  
>
>>exception.
>></problem>
>><Context>
>>package org.apache.xindice.core.query
>>class XPathQueryResolver
>><snip line="539">
>>      private Object evalFunction(String owner, int pos) throws Exception
>>    
>>
>{
>  
>
>>         int idx = cmp.getFirstChildPos(pos);
>>         int id = cmp.getOp(idx);
>>         int endFunc = pos + cmp.getOpMap()[pos+1] - 1;
>></snip>
>>the last line throws a NoSuchMethodError.
>>after looking the Xalan javadoc getOpMap() doesn't return an array.
>>I looked into CVS the current version and the code has changed (a bug fix
>>?) so it shouldn't throw an exception anymore (but I haven't tested it) I
>>use xindice in embeded mode.
>></context>
>><question>
>>What should I do ?
>>1) Do I use the wrong Xalan version ? Xindice 1.1b1 should use an older
>>version and I have to use endorse something ?
>>2) Do I have to update my Xindice library to the actual CVS ?
>></question>
>>thanks Julien
>>    
>>
>
>  
>


Re: Xpath query in xindice 1.1b1

Posted by Julien Le Dem <ju...@thet-is.com>.
So this is a bug in 1.1B1 (I mean, there's no way to have this working in
1.1b1)
A question that maybe of no use :
If the method was returning an array before, why Xalan dev don't leave it
with a @deprecated info ? I know it's ugly, but it prevents other projects
(like Xindice) to have bug in it.
Lazy me that wanted to use a pre-packaged jar ... I will have to build it
from CVS... :°-(
Is there any stability issue in CVS version that wasn't in the 1.1b1
"Milestone Release"?
I'm using very basic (but great ! don't be alarmed devs! ;-)
functionnalities like adding/replacing documents in collections and
performing XPath requests.
Thanks, Julien
----- Original Message ----- 
From: "JC Tchitchiama" <jc...@panonet.net>
To: <xi...@xml.apache.org>; "Julien Le Dem"
<ju...@thet-is.com>
Sent: Monday, November 10, 2003 3:44 PM
Subject: Re: Xpath query in xindice 1.1b1


Hi Julien,

When I came accross the problem I just decided to use the CVS version
which has something lile

...
code snippet
      private Object evalFunction(String owner, int pos) throws Exception {
         int idx = Compiler.getFirstChildPos(pos);
         int id = cmp.getOp(idx);
         int endFunc = cmp.getOp(pos +1) - 1;

         List args = new ArrayList();
         int lp = idx+1;
         while ( lp < endFunc ) {
            args.add(evaluate(owner, lp));
            lp = cmp.getNextOpPos(lp);
         }
...

Indeed the XPath Compiler interface has changes

On Monday 10 Nov 2003 1:34 pm, Julien Le Dem wrote:
> <problem>
> When sending an xpath request using a function (like count(...) ) I have
an
> exception.
> </problem>
> <Context>
> package org.apache.xindice.core.query
> class XPathQueryResolver
> <snip line="539">
>       private Object evalFunction(String owner, int pos) throws Exception
{
>          int idx = cmp.getFirstChildPos(pos);
>          int id = cmp.getOp(idx);
>          int endFunc = pos + cmp.getOpMap()[pos+1] - 1;
> </snip>
> the last line throws a NoSuchMethodError.
> after looking the Xalan javadoc getOpMap() doesn't return an array.
> I looked into CVS the current version and the code has changed (a bug fix
> ?) so it shouldn't throw an exception anymore (but I haven't tested it) I
> use xindice in embeded mode.
> </context>
> <question>
> What should I do ?
> 1) Do I use the wrong Xalan version ? Xindice 1.1b1 should use an older
> version and I have to use endorse something ?
> 2) Do I have to update my Xindice library to the actual CVS ?
> </question>
> thanks Julien

-- 

Best Regards.

JC.
           \\- - -//
          (  @ @  )
===oOOo-(_)-oOOo=================================================
      jct@panonet.net
=================================================================




Re: Xpath query in xindice 1.1b1

Posted by JC Tchitchiama <jc...@panonet.net>.
Hi Julien,

When I came accross the problem I just decided to use the CVS version
which has something lile

...
code snippet
      private Object evalFunction(String owner, int pos) throws Exception {
         int idx = Compiler.getFirstChildPos(pos);
         int id = cmp.getOp(idx);
         int endFunc = cmp.getOp(pos +1) - 1;

         List args = new ArrayList();
         int lp = idx+1;
         while ( lp < endFunc ) {
            args.add(evaluate(owner, lp));
            lp = cmp.getNextOpPos(lp);
         }
...

Indeed the XPath Compiler interface has changes 

On Monday 10 Nov 2003 1:34 pm, Julien Le Dem wrote:
> <problem>
> When sending an xpath request using a function (like count(...) ) I have an
> exception.
> </problem>
> <Context>
> package org.apache.xindice.core.query
> class XPathQueryResolver
> <snip line="539">
>       private Object evalFunction(String owner, int pos) throws Exception {
>          int idx = cmp.getFirstChildPos(pos);
>          int id = cmp.getOp(idx);
>          int endFunc = pos + cmp.getOpMap()[pos+1] - 1;
> </snip>
> the last line throws a NoSuchMethodError.
> after looking the Xalan javadoc getOpMap() doesn't return an array.
> I looked into CVS the current version and the code has changed (a bug fix
> ?) so it shouldn't throw an exception anymore (but I haven't tested it) I
> use xindice in embeded mode.
> </context>
> <question>
> What should I do ?
> 1) Do I use the wrong Xalan version ? Xindice 1.1b1 should use an older
> version and I have to use endorse something ?
> 2) Do I have to update my Xindice library to the actual CVS ?
> </question>
> thanks Julien

-- 

Best Regards.

JC.
           \\- - -//
          (  @ @  )
===oOOo-(_)-oOOo=================================================
      jct@panonet.net
=================================================================