Thank You Mike,

I was able to get that to work in pretty much the same way as you explained.

I put these lines in my xquery

declare variable $file as node() external;

and then passed the file stream using the setParameter method on the DynamicQueryContext object.

-Shreyas.




On Sat, 15 Apr 2006 Michael Kay wrote :
>There are three main ways of supplying an input file to a query:
>
>
>
>(a)    as the context item. (-s on the command line.) This allows one input
>only
>
>(b)    as the value of an external variable. This allows any number.
>Declare the variables in the query using "declare variable $input1
>external;" and supply the value from Java using setParameter() in the
>dynamic context.
>
>(c)    Using the doc() function. This is the simplest approach when the
>files are in filestore as the calling application doesn't need to get
>involved, the query just accesses the file using doc(file:///input1.xml)
>
>
>
>Michael Kay
>
>http://www.saxonica.com/
>
>
>
>
>
>
>
>  _____
>
> From: saxon-help-admin@lists.sourceforge.net
>[mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of shreyas
>Sent: 15 April 2006 18:47
>To: saxon-help@lists.sourceforge.net
>Subject: [saxon] xquery taking two xml files as inputs
>
>
>
>Hi,
>
>I have a question regarding giving 2 xml docs as input to the saxon xquery
>engine?
>
>How do you write to code (in java) to give two xml files as input to an
>xquery and how should the 2 files be accessed in the xquery?
>
>Thanks,
>
>-Shreyas.
>
>
>
>
><http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signa
>ture-home.htm/1507191490@Middle5?PARTNER=3>
>