Commons JXPath
  1. Commons JXPath
  2. JXPATH-108

problems with NodeSet returned from custom function.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: 1.3
    • Labels:
      None

      Description

      If a NodeSet (BasicNodeSet) is returned from a custom function,
      count() does not work and returns always 1.

      Perhaps could be added In ri.compiler.CoreFunction.java, method functionCount(EvalContext)

      else if (value instanceof Collection)

      {... }

      else if (value instanceof NodeSet)

      { count = ((NodeSet) value).getValues().size(); }

      or similiar.

        Activity

        Hide
        Michele Vivoda added a comment -

        lowered priority..

        Show
        Michele Vivoda added a comment - lowered priority..
        Hide
        Matt Benson added a comment -

        Fixed. Thanks!

        Show
        Matt Benson added a comment - Fixed. Thanks!
        Hide
        Matt Benson added a comment -

        Additional problem reported by M. Vivoda:
        selecting a single value from a returned NodeSet returns the nodeset rather than treating as a valid part of the xpath graph. User suggested fix for both issues (obviating the fix in CoreFunction) to convert the NodeSet to an EvalContext when the extension function is called. I agree with the analysis.

        Show
        Matt Benson added a comment - Additional problem reported by M. Vivoda: selecting a single value from a returned NodeSet returns the nodeset rather than treating as a valid part of the xpath graph. User suggested fix for both issues (obviating the fix in CoreFunction) to convert the NodeSet to an EvalContext when the extension function is called. I agree with the analysis.
        Hide
        Matt Benson added a comment -

        svn rev 604261.

        Show
        Matt Benson added a comment - svn rev 604261.

          People

          • Assignee:
            Unassigned
            Reporter:
            Michele Vivoda
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development