|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TODAY'S TOP SOA & WEBSERVICES LINKS Product Review XML Product Review: "Getting to Know Xindice"
An open source native XML database
By: Selim Mimaroglu
Feb. 14, 2006 07:45 PM
Apache Software Foundation's Xindice is an open source native XML database. Apache provides great software to developers such as the Apache Web Server, Tomcat Application Server, Cocoon Web Development Framework, Struts Framework, Ant, and many more under an open source license. Apache Web Server is an industrial-strength product that is used by many high-traffic Web sites. Apache Tomcat is a servlet container that implements both Java Servlets and Java Server Pages. The fact that Xindice is a member of the Apache Software Foundation gives it substantial credibility, because Apache produces well-known, well-respected software. We will explore the Xindice native XML database beginning with its installation and advancing step by step. As the Xindice home page suggests, you are encouraged to pronounce it as "zeen-dee-chay" with your best faux Italian accent. Xindice supports XPath query language, XML:DB, and XUpdate standards in Java, in addition to XML-RPC API for non-Java programmers.
Version 1.1 of Xindice doesn't run as a stand-alone server, but instead runs under a servlet 2.2-compliant application server. The documentation states that it's tested both with Tomcat and Jetty. Since Tomcat is very popular and I am familiar with it, I decided to run Xindice with Tomcat. You can download Tomcat from http://tomcat.apache.org. I downloaded the Windows executable, binary core distribution version 5.0.28. Because I already have a Java SDK (Software Development Kit) installed on my machine, I didn't need to download it again, but if you don't have a Java SDK, you have to download version 1.4.x of J2SE (Java 2 Standard Edition) from http://java.sun.com. I installed Xindice and Tomcat and tested all of the examples in this article on my laptop, a 1.4GHz Pentium M processor, running on Windows XP Professional with 512MB main memory, without any problems. These are the installations steps I followed:
Starting or stopping the Xindice native XML database means starting or stopping the Tomcat Server. Tomcat by default runs on port 8080, and you can change the port during or after the installation. To check if your Tomcat is running properly, after starting it visit http://localhost:8080/ (or http://127.0.0.1:8080/ ): you should see the welcome page.
Command-Line Tool
Let's list the collections installed by Xindice after the installation. Remember that the server should be running in order to execute this command successfully:
> xindice list_collections -c xmldb:xindice://localhost:8080/db Each command has an abbreviated version. For example, we could have used lc instead of list_collections. For clarity, in this article I will use the full name of the commands. After familiarizing yourself with Xindice, you probably won't want to write the commands in full. You can find the abbreviated versions and the descriptions of all the commands at the Xindice Commandline Tool Guide. In this example, the full context is xmldb:xindice://localhost:8080/db, which is specified by the -c option. When using Tomcat we have to specify the full context: Tomcat runs on port 8080, but Xindice is preconfigured for Jetty, which runs on port 8888. If you don't want to specify the full context, you have two options: change the Tomcat's port to 8888 or install Jetty instead of Tomcat. If the server is running on a different machine and not on the localhost, you should replace the localhost portion of the context with the correct URL. After executing this command the system responded by telling us that there are two collections: systems and meta. Like the other popular open source native XML databases such as eXist and Berkeley DB XML, Xindice too uses the idea of collection. A collection is similar to a folder in terms of functionality. You can have several XML files under a collection, which is a neat way of organizing the documents.
Adding a Collection
> xindice add_collection -c xmldb:xindice://localhost:8080/db -n dictionary As in the previous example, -c specifies the context that is the root location (all of the data files and collections are stored under this location). By executing this command successfully we created a subcollection called dictionary. The context of this new location is xmldb:xindice://localhost:8080/db/dictionary. Listing the collections reveals that now we have three collections, of which two of them were previously created.
> xindice list_collections -c xmldb:xindice://localhost:8080/db XML JOURNAL LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING XML NEWS
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||