XPathVariable bound to the wrong slot?

View: New views
4 Messages — Rating Filter:   Alert me  

XPathVariable bound to the wrong slot?

by Norman Walsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Mike,

Perhaps I'm looking past the obvious, but consider this code:

 QName doca = new QName("","doca");
 QName docb = new QName("","docb");

 XdmNode t = expectedOutputFromPipeline();
 XdmNode p = actualOutputFromPipeline();

 XPathCompiler xcomp = xproc.getProcessor().newXPathCompiler();
 xcomp.declareVariable(doca);
 xcomp.declareVariable(docb);

 XPathExecutable xexec = xcomp.compile("deep-equal($doca,$docb)");
 XPathSelector selector = xexec.load();

 selector.setVariable(doca,t);
 selector.setVariable(docb,p);

When the first selector.setVariable() is called, I get:

  Exception in thread "main" net.sf.saxon.s9api.SaxonApiException:
  Supplied XPathVariable is bound to the wrong slot: perhaps it was
  created using a different static context

Different than what? Is the problem here that I've created the *value*
of the doca variable with a different static context than the static
context being used here to instantiate the XPathVariable?

                                        Be seeing you,
                                          norm

--
Norman Walsh <ndw@...> | Words ought to be a little wild for
http://nwalsh.com/            | they are assaults of thought on the
                              | unthinking.--John Maynard Keynes


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

attachment0 (191 bytes) Download Attachment

Re: XPathVariable bound to the wrong slot?

by Menzo Windhouwer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I recently encountered the same exception, see this thread:

   
http://saxon.markmail.org/search/?q=wrong%20slot#query:wrong%20slot+page:1+mid:ylcvoyrtrvzku6an+state:results

Michael resolved it very quickly (thanks once more :-). You need to
apply the following patch to 9.1.0.1:

   
http://saxon.svn.sourceforge.net/viewvc/saxon/latest9.1/bj/net/sf/saxon/sxpath/IndependentContext.java?r1=259&r2=263

In my case my code works fine again :-)

Hope this helps,

Menzo Windhouwer

Norman Walsh wrote:

> Hi Mike,
>
> Perhaps I'm looking past the obvious, but consider this code:
>
>  QName doca = new QName("","doca");
>  QName docb = new QName("","docb");
>
>  XdmNode t = expectedOutputFromPipeline();
>  XdmNode p = actualOutputFromPipeline();
>
>  XPathCompiler xcomp = xproc.getProcessor().newXPathCompiler();
>  xcomp.declareVariable(doca);
>  xcomp.declareVariable(docb);
>
>  XPathExecutable xexec = xcomp.compile("deep-equal($doca,$docb)");
>  XPathSelector selector = xexec.load();
>
>  selector.setVariable(doca,t);
>  selector.setVariable(docb,p);
>
> When the first selector.setVariable() is called, I get:
>
>   Exception in thread "main" net.sf.saxon.s9api.SaxonApiException:
>   Supplied XPathVariable is bound to the wrong slot: perhaps it was
>   created using a different static context
>
> Different than what? Is the problem here that I've created the *value*
> of the doca variable with a different static context than the static
> context being used here to instantiate the XPathVariable?
>
>                                         Be seeing you,
>                                           norm
>
>  
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/saxon-help 


--
Menzo Windhouwer, Theoretische Taalwetenschap (UvA)
kamer 306, Spuistraat 210 (Bungehuis) 1012 VT A'dam
telefoon:020 525 3104, e-mail:M.A.Windhouwer@...


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: XPathVariable bound to the wrong slot?

by Michael Kay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


A known bug in 9.1, I'm afraid:

https://sourceforge.net/tracker/index.php?func=detail&aid=2010718&group_id=2
9872&atid=397617

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: saxon-help-bounces@...
> [mailto:saxon-help-bounces@...] On Behalf
> Of Norman Walsh
> Sent: 16 July 2008 14:49
> To: saxon-help@...
> Subject: [saxon] XPathVariable bound to the wrong slot?
>
> Hi Mike,
>
> Perhaps I'm looking past the obvious, but consider this code:
>
>  QName doca = new QName("","doca");
>  QName docb = new QName("","docb");
>
>  XdmNode t = expectedOutputFromPipeline();  XdmNode p =
> actualOutputFromPipeline();
>
>  XPathCompiler xcomp = xproc.getProcessor().newXPathCompiler();
>  xcomp.declareVariable(doca);
>  xcomp.declareVariable(docb);
>
>  XPathExecutable xexec = xcomp.compile("deep-equal($doca,$docb)");
>  XPathSelector selector = xexec.load();
>
>  selector.setVariable(doca,t);
>  selector.setVariable(docb,p);
>
> When the first selector.setVariable() is called, I get:
>
>   Exception in thread "main" net.sf.saxon.s9api.SaxonApiException:
>   Supplied XPathVariable is bound to the wrong slot: perhaps it was
>   created using a different static context
>
> Different than what? Is the problem here that I've created
> the *value* of the doca variable with a different static
> context than the static context being used here to
> instantiate the XPathVariable?
>
>                                         Be seeing you,
>                                           norm
>
> --
> Norman Walsh <ndw@...> | Words ought to be a little wild for
> http://nwalsh.com/            | they are assaults of thought on the
>                               | unthinking.--John Maynard Keynes
>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

Re: XPathVariable bound to the wrong slot?

by Norman Walsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

/ Menzo Windhouwer <M.A.Windhouwer@...> was heard to say:
| Michael resolved it very quickly (thanks once more :-). You need to
| apply the following patch to 9.1.0.1:

Thanks, indeed! That fixed it.

                                        Be seeing you,
                                          norm

--
Norman Walsh <ndw@...> | If you understand: things are as they
http://nwalsh.com/            | are. If you do not understand: things
                              | are as they are.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help 

attachment0 (191 bytes) Download Attachment
LightInTheBox - Buy quality products at wholesale price