On Feb 22, 2011, at 9:07 AM, Lahiru Gunathilake wrote: > Hi all, > > I want to use the Xindice to store some XML files and query the data using > XPath. Where can I find a simple instruction on how to do this ? After going > through the documentation I was able to start the Xindice with Jetty and > after setting up the classpaths in the examples I was able to execute the > samples but I am getting following error when run the samples. > > . > trying to register database > Exception in thread "main" org.apache.xindice.util.XindiceException: > DatabaseManager.getCollection(xmldb:xindice:///db/addressbook) returned null. > at > org.apache.xindice.examples.AbstractExample.getCollection(AbstractExample.java:57)
Apparently, the collection /db/addressbook cannot be found. You can create the collection by running a command: bin/xindice ac -c /db -n addressbook For other commands available from command line, please see command-line tool built-in help (bin/xindice --help) or Xindice Commandline Tool Guide [1]. > Am I doing something wrong ? I do not bother what mode Xindice is running > since I am working on a PoC, ideally I will be using embedded Xindice but for > the time being I can run with Jetty since it's pretty much straight forward. > > If you can point me to a good documentation that would be greatful. I would recommend to take a look at Xindice Developer Guide [2] (it mentions running examples as well) and checking source code for examples and command tool. [1] http://xml.apache.org/xindice/1.2/guide-tools.html [2] http://xml.apache.org/xindice/1.2/guide-developer.html Regards, Natalia > Regards > Lahiru > > -- > Lahiru Gunathilake > Senior Software Engineer - WSO2 Inc. www.wso2.com > > Email:lah...@wso2.com Blog: www.lahiru.org > Mobile: +94716381143 > > Lean . Enterprise . Middleware >