I'm afraid I'm only answering this by reading the XQJ spec; I never use XQJ myself so I'm no great expert.

You have to use xqeTemp.bindSequence(). Which means you have to construct an XQSequence object. The Saxon implementations of this interface have no public constructors, and the Saxon implementation of bindSequence() won't accept an implementation of XQSequence other than the ones it knows about. So I think the only option is to get the value as the result of another query.

XQJ is full of limitations like this and unless you have very good reasons for wanting a portable API, I would recommend using s9api instead.

Michael Kay
Saxonica


On 29 Apr 2013, at 14:38, Kunal Chauhan wrote:


Hi,

how can I bind multiple value to a variable ?

Suppose, I am declaring an external variable v1 and want to pass list / array of value (10,20,30) how can I achieve this ?

Example :

 int v1 = 5;
             SaxonXQExpression xqeTemp = (SaxonXQExpression)XQueryConnection.getConnection().createExpression();
             xqeTemp.bindObject(new QName("v1"), Integer.parseInt(v1),null);


             XQResultSequence xqsTemp =  xqeTemp.executeQuery("declare variable $v1 external; \n" +   
                                                                 "return $v1 + 5");
             System.out.println(" Result : "+xqsTemp.getSequenceAsString(null));


Here, in above example I bind variable v1 with the value 5 and do some operation in query. Now instead of single value I wants to bind multiple value with variable v1. So, how can I do this ?

please guide me.

Thanks and Regards,
--
Kunal Chauhan
[+918655517141]
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help