[DFDL-WG] clarification: fn:exactly-one function

Andrew Edwards andy.edwards at uk.ibm.com
Mon Nov 3 09:11:45 EST 2014


HI Mike(et al)

I would suggest that we already have a function that can return true when 
the count is 1 and false in all other cases:    (fn:count($arg) == 1) 
would achieve the same.

It sounds like fn:exactly-one is design to act like an assertion in XPath. 
 I'm more concerned that XPath returns $arg on success, and we return 
"true".

Andy 
Andy Edwards - IBM Integration Bus - DFDL


Email:
andy.edwards at uk.ibm.com
Snail Mail: 
MP211, Hursley park, Hursley, WINCHESTER, Hants, SO21 2JN
Tel int:
247222
Tel ext:
+44 (0)1962 817222
Desk:
DE3 V17

The Feynman problem solving Algorithm
  1) Write down the problem
  2) Think real hard
  3) Write down the answer
 -- Murray Gell-mann in the NY Times




From:   Mike Beckerle <mbeckerle.dfdl at gmail.com>
To:     "dfdl-wg at ogf.org" <dfdl-wg at ogf.org>
Date:   30/10/2014 10:00
Subject:        [DFDL-WG] clarification: fn:exactly-one function
Sent by:        dfdl-wg-bounces at ogf.org




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."
It seems of value to have a true/false result, because something that 
raises an error like this can only be used as an assertion effectively. On 
the other hand, that's not what XPath does.

Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | 
www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are 
subject to the OGF Intellectual Property Policy
--
  dfdl-wg mailing list
  dfdl-wg at ogf.org
  https://www.ogf.org/mailman/listinfo/dfdl-wg

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20141103/80786c78/attachment.html>


More information about the dfdl-wg mailing list