jaxen
FAQ | JavaDoc | download | status | project page

Status

Change History
    Changes in CVS since last release
    Jaxen 1.0 RC1
    Jaxen 1.0 beta 8
To Do List
Known problems
Contributors

Change History

Changes in CVS since last release

Jaxen 1.0 RC1

There is now an XPath interface in the org.jaxen package to represent any XPath implementation. So this means that the XPath API of Jaxen is now polymorphic, the same interface can work with any model.

This now means that the org.jaxen.* package represents a purely interface based API to any XPath engine. So it should be possible to implement XPath, FunctionContext, NamespaceContext, VariableContext on any XPath engine if so desired.

The XPath implementation for each model has now got a fully qualified class name. The following code describes how to instantiate an XPath object for each model.

// for DOM
XPath xpath = new DOMXPath( "//foo" );

// for dom4j
XPath xpath = new Dom4jXPath( "//foo" );

// for Electric XML
XPath xpath = new ElectricXPath( "//foo" );

// for JDOM
XPath xpath = new JDOMXPath( "//foo" );

The XPath.valueOf() method is now deprecated, XPath.stringValueOf() should be used instead.

Added new extension functions kindly provided by Mark Wilson. They are as follows...
*upper-case() - converts the first argument to an upper case string using either the default Locale or the Locale specified by the second parameter
*lower-case() - converts the first argument to a lower case string using either the default Locale or the Locale specified by the second parameter
*ends-with() - evaluates true if the first string ends with the postfix

Locales can be specified either using a variable which is a Locale object or using an xml:lang style string which specifies the Locale via a language together with an optional country and variant such as 'fr', 'fr-CA' or 'es-ES-Traditional_WIN'. e.g.

upper-case( @foo, $myLocale )
upper-case( /foo/bar, 'fr' )
lower-case( foo, 'fr-CA' )
upper-case( @foo, 'es-ES-Traditional_WIN' )

The translate() function is now implemented - thanks to Jan for that!

Some auxillary implementation detail changes, which shouldn't affect the public API in any way are as follows
*The org.jaxen.JaXPath class has been removed. Now we have an org.jaxen.XPath interface its no longer required.
*The org.jaxen.expr.XPath class has been renamed to org.jaxen.expr.XPathExpr to avoid confusion and to use a more consistent name. Similarly the DefaultXPath class has been renamed to DefaultXPathExpr as well.
*The very confusing jaSelect*() methods have gone from JaXPath and BaseXPath. All evaluation methods can take a Context object, null, a node or a node set.

Jaxen 1.0 beta 8

Initial beta development cycle. Please see CVS changelogs for up-to-date list of changes.

To Do List

*Implement a GenericXPath which could use reflection on the nodes passed into it to choose the Navigator to use. So the same GenericXPath instance could be used to evaluate XPaths on any object. This feature would be particularly useful in JSTL since it would allow web developers to mix and match any all XML models.
*While already Jaxen is pretty fast but we are sure it could use some more tuning.
*selectSingleNode() and possibly the *ValueOf() methods should be return-fast as a performance improvement. For example selectSingleNode( "//foo" ) on a document with lots of <foo/> elements would actually create a full nodeset of results then extract the first element - rather than just returning as soon as the first one is found.
*Better user guides and examples!
*Any Locale sepecific functions, such as upper-case() and lowercase-case() could well follow the example of XSLT 2.0 by using the Unicode case mappings

Known problems

*The format-number() XPath function needs implementing. Any volunteers?
*id() function not implemented for most models.

Contributors

The following people have contributed to the Jaxen project. Many thanks to you all!

*Bob McWhirter (The Werken Company)
*James Strachan (SpiritSoft)
*David Megginson (Megginson Technologies)
*Erwin Bolwidt
*David Peterson
*Mark A. Belonga
*Christian Nentwich
*Alexander Day Chaffee (Purple Technology)
*Elliotte Rusty Harold (Cafe con Leche)
*Mark Wilson (WilsonCon)
*Jan Dvorak
*Jérôme Nègre (e-xmlmedia.com)


jaxen
FAQ | JavaDoc | download | status | project page

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