jaxen
FAQ | JavaDoc | download | status | project page

Frequently Asked Questions

What is Jaxen?
What is the Jaxen license?
Why is Jaxen useful?
Why is Jaxen better than <some other xpath technology>
What are some related technologies?
How do I support a different object model?
Is Jaxen only good for XPath evaluation?
Who uses Jaxen?

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 and JDOM.

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, JavaBeans, or whatnot.

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, EXML 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. Additionally, The Mind Electric's EXML is supported, providing better XPath support within the GLUE platform. 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 to provide easy XPath evaluation directly from your documents. Additionally, it's being integrated into David Megginson's NewsML Framework.



jaxen
FAQ | JavaDoc | download | status | project page

Copyright 2001 (C) bob mcwhirter & James Strachan. All rights reserved. Hosted by SourceForge
SourceForge Logo