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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to