##### jaxen

- Overview
- Download Jaxen
- API Documentation
- FAQ
- Writing Extension Functions
- Releases
- CVS Access
- Status

##### Project Documentation

- About jaxen
- Project Info
- Project Reports
- Development Process

## What is jaxen?

The `jaxen` project is a Java XPath Engine. `jaxen` is a universal object model walker, capable of evaluating XPath expressions across multiple models. Currently supported are dom4j, JDOM, and DOM.

## What is the jaxen license?

We use an Apache-style open source license which is one of the least restrictive licenses around, you can use `jaxen` to create new products without them having to be open source.

## Why is jaxen useful?

After implementing an XPath engine for both dom4j and JDOM, and attempting to keep them both in sync, it was decided that factoring out the commonality would be a Good Thing. Thus, `jaxen` provides a single point for XPath expression evaluation, regardless of the target object model, whether its dom4j, JDOM, DOM, XOM, JavaBeans, or what not.

## Why is jaxen better than [some other xpath technology]

`jaxen` is better than `werken.xpath` specifically because it better handles XPath expressions, and syntax error reporting. Additionally, since jaxen is a unified code-base, developer effort isn't split between maintaining the dom4j version and the JDOM version. More hands working on the same project reduces bug count.

`jaxen` may be perceived to be better than other XPath technologies since it provides a single cohesive API for evaluating XPaths against multiple object models. Learn the `jaxen` API, and apply it to dom4j, JDOM, XOM or DOM trees in exactly the same way.

Also, since `jaxen` works against an adaptor which provides InfoSet access to arbitrary object models, it should be possible to build even larger tools in terms of `jaxen`, to work with multiple models. For example, an XQL engine could be developed, which would automagically work with all models already supported by `jaxen`.

## What are some related technologies?

`jaxen` itself is based upon SAXPath, which is an event-based model for parsing XPath expressions.

`jaxen` currently has navigators defined for dom4j and JDOM, two popular and convenient object models for representing XML documents. Of course, W3C DOM is also supported.

## How do I support a different object model?

The only thing required is an implementation of the interface `org.jaxen.Navigator`. Not all of the interface is required, and a default implementation, in the form of `org.jaxen.DefaultNavigator` is also provided.

Since many of the XPath axes can be defined in terms of each other (for example, the `ancestor` axis is merely a the `parent` recursively applied), only a few low-level axis iterators are required to initially get started. Of course, you may implement them directly, instead of relying upon `jaxen`'s composition ability.

## Is jaxen only good for XPath evaluation?

No.

The `DocumentNavigators` provided with `jaxen` would be used by themselves, without the XPath evaluation engine, to provide univeral access to many object models for other technologies.

## Who uses jaxen?

`jaxen` has been embedded directly into dom4j and XOM 1.1 to provide easy XPath evaluation directly from your documents. Additionally, it's being integrated into David Megginson's NewsML Framework.