Re: [basex-talk] Simple query

2017-03-11 Thread Aaron Weber
>>>> >>>> On 3/10/2017 4:18 PM, Kendall Shaw wrote: >>>> >>>> This worked for me, where “test-local” contains a document: >>>> >>>> >>>> >>>> Context context = new Context(); >>>> >>>>

Re: [basex-talk] Simple query

2017-03-11 Thread Christian Grün
contains a document: >>> >>> >>> >>> Context context = new Context(); >>> >>> LocalSession s = new LocalSession(context); >>> >>> s.execute(new Check("test-local")); >>> >>>

Re: [basex-talk] Simple query

2017-03-11 Thread Aaron Weber
>> LocalSession s = new LocalSession(context); >> >> s.execute(new Check("test-local")); >> >> try (Query q = s.query("for $doc in collection() return >$doc")) { >> >> while (q.more()) { &g

Re: [basex-talk] Simple query

2017-03-11 Thread Christian Grün
} > > > > But, why your code isn’t working could be useful to know. It seems like > there are some details left out. > > > > Kendall > > > > From: on behalf of AJ Weber > > Date: Friday, March 10, 2017 at 11:40 AM > To: "basex-talk@mailman.uni-

Re: [basex-talk] Simple query

2017-03-10 Thread Kendall Shaw
n.uni-konstanz.de" Subject: Re: [basex-talk] Simple query OK, changing this so that the code flows like yours works much, much better. I now return all 3 documents I expect are in the database. FOLLOW-UP Question: How do I close the database properly with these classes? I had been doing a conte

Re: [basex-talk] Simple query

2017-03-10 Thread AJ Weber
n(q.next()_);_ } } But, why your code isn’t working could be useful to know. It seems like there are some details left out. Kendall *From: * on behalf of AJ Weber *Date: *Friday, March 10, 2017 at 11:40 AM *To: *"basex-talk@mailman.uni-konstanz.de" *Subjec

Re: [basex-talk] Simple query

2017-03-10 Thread AJ Weber
t seems like there are some details left out. Kendall *From: * on behalf of AJ Weber *Date: *Friday, March 10, 2017 at 11:40 AM *To: *"basex-talk@mailman.uni-konstanz.de" *Subject: *Re: [basex-talk] Simple query On 3/10/2017 2:24 PM, Kendall Shaw wrote: Michael Seiferle gave

Re: [basex-talk] Simple query

2017-03-10 Thread Kendall Shaw
ot;basex-talk@mailman.uni-konstanz.de" Subject: Re: [basex-talk] Simple query On 3/10/2017 2:24 PM, Kendall Shaw wrote: Michael Seiferle gave the answer already, I think. What would collection() be referring to? How would BaseX know what to return? Probably there is no database specified. Presumab

Re: [basex-talk] Simple query

2017-03-10 Thread AJ Weber
, "basex-talk@mailman.uni-konstanz.de" *Subject: *Re: [basex-talk] Simple query On 3/9/2017 3:46 AM, Fabrice ETANCHAUD wrote: Hello Aaron, You would learn faster by using the BaseXGUI application, You will benefit from syntax highlighting, real time execution, a

Re: [basex-talk] Simple query

2017-03-10 Thread Kendall Shaw
:44 AM To: Fabrice ETANCHAUD , "basex-talk@mailman.uni-konstanz.de" Subject: Re: [basex-talk] Simple query On 3/9/2017 3:46 AM, Fabrice ETANCHAUD wrote: Hello Aaron, You would learn faster by using the BaseXGUI application, You will benefit from syntax highlighting, real time execution

Re: [basex-talk] Simple query

2017-03-10 Thread AJ Weber
tatement, e); } Best regards, Fabrice *De :*basex-talk-boun...@mailman.uni-konstanz.de [mailto:basex-talk-boun...@mailman.uni-konstanz.de] *De la part de* Aaron Weber *Envoyé :* jeudi 9 mars 2017 00:31 *À :* basex-talk@mailman.uni-konstanz.de *Objet :* [basex-talk] Simple query Newbie ale

Re: [basex-talk] Simple query

2017-03-10 Thread AJ Weber
Sorry for the delayed response... I was aware of the empty collection and default (but maybe not clear on it)... This query works: String myXQueryString ="for $doc in collection() where matches(document-uri($doc), '" + DocID + "') return $doc"; return (new XQuery(myXQueryString).exe

Re: [basex-talk] Simple query

2017-03-09 Thread Fabrice ETANCHAUD
la part de Aaron Weber Envoyé : jeudi 9 mars 2017 00:31 À : basex-talk@mailman.uni-konstanz.de Objet : [basex-talk] Simple query Newbie alert. I'm trying to get my feet wet with BaseX, and in doing so, am trying to understand XQuery and how to apply it to a database full of documents (not ju

Re: [basex-talk] Simple query

2017-03-09 Thread Michael Seiferle
Hi Aaron, welcome to the list! For BaseX to „open“ a collection you need to address it by URI; in your case no URI is present, so BaseX loads the „default collection“ which is set to the currently opened database (I guess you have none open :—)): So usually you want to address your collectio

[basex-talk] Simple query

2017-03-08 Thread Aaron Weber
Newbie alert. I'm trying to get my feet wet with BaseX, and in doing so, am trying to understand XQuery and how to apply it to a database full of documents (not just a single document that is typically queried). I am using Java and can post my code, but with a LocalSession, and a query, the