You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/07/23 20:29:18 UTC
DO NOT REPLY [Bug 30298] New: -
evaluate xpath expressions in functions
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30298>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=30298
evaluate xpath expressions in functions
Summary: evaluate xpath expressions in functions
Product: Commons
Version: 1.1 Final
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: Enhancement
Priority: Other
Component: JXPath
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: kwongfu@hotmail.com
It is not clear in the doc comments how to call a function in such a way that
certain parameters are evaluated as XPath expressions before being passed to
the method.
For example, in the PackageFunctions doc comments, it gives the example:
"util:substring('foo', 1, 2)" is equivalent to "foo".substring(1, 2)
which is not an especially useful example, as both are inefficient equivalents
of the expression "fo".
A more interesting example involve an expression like:
"util:substring('person/name/middleName', 1, 1)"
which could be used to get the middle initial of a person. The problem is how
to indicate that this should be context.getJXPathContext().getValue
("person/name/middleName").substring(1, 1) instead
of "person/name/middleName".substring(1, 1).
Without the facility to indicate that some parameters are XPath expressions,
existing methods cannot be used without writing wrapper methods to evaluate
the XPath expressions.
If such a facility already exists, the doc comments of PackageFunctions, etc.
should be updated to describe it.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org