Yes, that I know. I bind several different items. but the scenario is after some processing I get some value / nodes which I need to bind to execute query. in this case, I didn't get any value / node. Still I need to run the query.
declare variable $a external; return empty($a) Query is generated dynamically, variable is defined but for $a I didn't get any value. So, I am unable to bind it. and that's why I getting an error. On Wed, Jun 19, 2013 at 4:20 PM, Michael Kay <[email protected]> wrote: > Yes, of course you can bind a value from the application. In XQJ that's > done using the bind...() methods of XQDynamicContext. > > Michael Kay > Saxonica > > On 19 Jun 2013, at 08:58, Kunal Chauhan wrote: > > Yes Michael, You are right. > as soon as I run this query through java code where I am using XQuery 1.0 > and XQJ implementation. It gives me an error. > > earlier I tried with Query editor so it works. but after integrating it > with java code it doesn't. > > Is there any way to bind an empty sequence or any other work around? > > > > On Wed, Jun 19, 2013 at 12:52 PM, Michael Kay <[email protected]> wrote: > >> Actually, this is XQuery 3.0 syntax. >> >> XQuery 1.0 gives you no way to define a default value for an external >> variable (a crazy omission). >> >> You clearly have an expectation that the default value for an external >> variable should be an empty sequence. You may regard that as intuitive, but >> it's not what the spec says. >> >> Michael Kay >> Saxonica >> >> >> >> On 19 Jun 2013, at 07:34, Kunal Chauhan wrote: >> >> Thanks David, Thanks for your quick response. >> It's works. >> can you tell me logic behind this ? >> >> >> On Wed, Jun 19, 2013 at 11:44 AM, David Lee <[email protected]> wrote: >> >>> try **** >>> >>> ** ** >>> >>> declare variable $a external := ();**** >>> >>> ** ** >>> >>> ** >>> >> > > > -- > *Kunal Chauhan* > [email protected] > [+918655517141] > _______________________________________________ > [email protected] > http://x-query.com/mailman/listinfo/talk > > > -- *Kunal Chauhan* [email protected] [+918655517141]
_______________________________________________ [email protected] http://x-query.com/mailman/listinfo/talk
