Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1087

Discrepancy between DFDL spec and XPath description of fn:exactly-one

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 1.0.0
    • None
    • None
    • None

      According to the DFDL spec, fn:exactly-one returns "True if the provided sequence contains exactly one node/value," which suggests that the function would return false if the sequence contains > or < 1 node/value.

      The XPath description states that fn:exactly-one "returns $arg if it contains exactly one item. Otherwise, raises an error."

      The actual behavior seems to be a combination of the two. If the provided sequence contains exactly one node/value, the function returns True (instead of $arg), and if the provided sequence contains > or < 1 node/value, the function throws the following error:

      [error] Test edu.illinois.ncsa.daffodil.section23.dfdl_expressions.TestDFDLExpressions.test_exactly_one_02 failed: edu.illinois.ncsa.daffodil.processors.ParseError: Parse Error: Expression evaluation failed. Details: net.sf.saxon.trans.XPathException: A sequence of more than one item is not allowed as the first argument of fn:exactly-one() (<ex:item/>, <ex:item/>, ...)

              jchab Jessie Chab
              jchab Jessie Chab
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: