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 collection by name: > for $foo in collection(‚myFoos‘) > … > return $foo Where each $foo resembles a document inside your collection. In BaseX a collection usually resembles a database, so your first step would be: - Create a database that either is a single document or contains multiple documents So in SQL lingo I’d say you are basically missing your FROM ‚…‘ :-) A good read might be: http://docs.basex.org/wiki/Databases <http://docs.basex.org/wiki/Databases> it shows the various ways of creating, returning and querying documents / collections :-) Best Michael > Am 09.03.2017 um 00:30 schrieb Aaron Weber <awe...@comcast.net>: > > 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 following produces 0 results. > > For $doc in collection() return $doc > > I realize there's no "where", and in the sql world that would match all. > Maybe not in XQuery? > > Obviously just a test query, but I need to start somewhere. :-) > > Thanks for any help! > -- > AJ -- Michael Seiferle, BaseX GmbH, http://www.basexgmbh.de |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Fon: +49 7531 916 82 77