commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Raess <co...@gmx.ch>
Subject [JXPath] Analyze Expressions
Date Mon, 31 May 2004 12:59:51 GMT
Hi

I'm having a look at JXPath. It's really great! Just a few questions...

One reason why I'm interested in JXPath is that it contains an XPath 
parser. I want to use xpath in a similar way as CSS selectors are used 
in CSS. In CSS there is a notion of a selectors specificity. I need the 
same for xpath expressions. In order to calculate the specificity of a 
LocationPath I need access to the syntax tree of the expression (how to 
calculate the specificity is another question I'll have to solve...). 
However, I've seen that the method getExpression in 
JXPathCompiledExpression is protected. If I change it to public I have 
access to the complete syntax tree of the expression. Is there a 
particular reason, why this method should not be public? If somebody 
(like me) uses the classes from the reference implementation directly, 
why should he not get the benefit of access to the syntax tree? At 
first glance it seems that the access is read-only anyway, so I can't 
"break" anything.

I've changed the access modifier from protected to public and started 
analyzing compiled expressions. When I get the predicates from a Step 
object that does not have any predicates, it returns null. It would be 
nice if it returned an empty array. But of course, this may just be a 
matter of preference...

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message