You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Mark R. Diggory" <md...@latte.harvard.edu> on 2003/07/02 04:39:04 UTC

[jxpath] jxpath vs jaxen

I'm currently evaluating XPath engines for a project I'm working on. I 
notice JSTL uses Jaxen, while the Commons has its own JXPath. I notice 
James Strachan among others have worked on both engines.

I'm primarily want to use JXPath (or Jaxen) for working on DOM objects 
in java classes of my own design. Is there any benifit to using either 
of these engines over the other?

thanks,
Mark

-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu



Re: [jxpath] jxpath vs jaxen

Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.
Thank you, this is all very helpfull. I am currently working with what 
could only be described as a "dual object" model where DOM fragments of 
a Document can be gotten at though two different approaches (1. via a 
Map/Collection like java class object that holds references to various 
parts of the document and 2. by traversing the Document's DOM directly). 
I want to use the Object model to provide a standard interface for 
adding/removing specific sections of the DOM which represent "resources" 
in our system, while the rest of the DOM content can be easily 
manipulated through manipulating the DOM directly. So it would appear 
that JXPath would probibly be ideal in this situation too.

-Mark

Dmitri Plotnikov wrote:

>Mark,
>
>Here's how you choose between Jaxen and JXPath:
>
>1. If you are applying XPaths to nothing but XML structures you might
>want to consider a native framework like Xalan, Jaxen or JXP. Jaxen
>will allow you to work with XML in a variety of ways: it supports
>several models including DOM, JDOM, DOM4J etc.  
>
>2. If you are working exclusively with Java objects, you might want to
>consider an alternative to XPath as an expression language.  Jexl, EL
>and ECMAscript are more java-like, which makes them preferred
>alternatives to XPath.
>
>3. JXPath is primarily designed to work in mixed environments, where
>you have some JavaBeans and other kinds of in-memory Java objects like
>maps, arrays, lists etc as well as XML. If you want to use XPath as
>your expression language in such a mixed environment, JXPath is your
>solution of choice.  An example of such an environment is a Java
>implementation of XForm. With XForms, the forms are sometimes backed by
>Java objects, thus the need for the transparent traversal of
>heterogeneous object graphs.
>
>JXPath was initially developed by yours truly at Plotnix, Inc.  James
>did not actually work on JXPath, however he was tremendously helpful in
>bringing JXPath to Apache. 
>
>
>- Dmitri
>
>
>--- "Mark R. Diggory" <md...@latte.harvard.edu> wrote:
>  
>
>>I'm currently evaluating XPath engines for a project I'm working on.
>>I 
>>notice JSTL uses Jaxen, while the Commons has its own JXPath. I
>>notice 
>>James Strachan among others have worked on both engines.
>>
>>I'm primarily want to use JXPath (or Jaxen) for working on DOM
>>objects 
>>in java classes of my own design. Is there any benifit to using
>>either 
>>of these engines over the other?
>>
>>thanks,
>>Mark
>>
>>-- 
>>Mark Diggory
>>Software Developer
>>Harvard MIT Data Center
>>http://www.hmdc.harvard.edu
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>SBC Yahoo! DSL - Now only $29.95 per month!
>http://sbc.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>


-- 
Mark Diggory
Software Developer
Harvard MIT Data Center
http://www.hmdc.harvard.edu



Re: [jxpath] jxpath vs jaxen

Posted by Dmitri Plotnikov <dp...@yahoo.com>.
Mark,

Here's how you choose between Jaxen and JXPath:

1. If you are applying XPaths to nothing but XML structures you might
want to consider a native framework like Xalan, Jaxen or JXP. Jaxen
will allow you to work with XML in a variety of ways: it supports
several models including DOM, JDOM, DOM4J etc.  

2. If you are working exclusively with Java objects, you might want to
consider an alternative to XPath as an expression language.  Jexl, EL
and ECMAscript are more java-like, which makes them preferred
alternatives to XPath.

3. JXPath is primarily designed to work in mixed environments, where
you have some JavaBeans and other kinds of in-memory Java objects like
maps, arrays, lists etc as well as XML. If you want to use XPath as
your expression language in such a mixed environment, JXPath is your
solution of choice.  An example of such an environment is a Java
implementation of XForm. With XForms, the forms are sometimes backed by
Java objects, thus the need for the transparent traversal of
heterogeneous object graphs.

JXPath was initially developed by yours truly at Plotnix, Inc.  James
did not actually work on JXPath, however he was tremendously helpful in
bringing JXPath to Apache. 


- Dmitri


--- "Mark R. Diggory" <md...@latte.harvard.edu> wrote:
> I'm currently evaluating XPath engines for a project I'm working on.
> I 
> notice JSTL uses Jaxen, while the Commons has its own JXPath. I
> notice 
> James Strachan among others have worked on both engines.
> 
> I'm primarily want to use JXPath (or Jaxen) for working on DOM
> objects 
> in java classes of my own design. Is there any benifit to using
> either 
> of these engines over the other?
> 
> thanks,
> Mark
> 
> -- 
> Mark Diggory
> Software Developer
> Harvard MIT Data Center
> http://www.hmdc.harvard.edu
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com