FpML Issues Tracker

981: add function isUnique()

July 10, 2009

closed

Minor

Have not tried

Validation Rules

Admin

None

Summary

Please add the function isUnique().

At the moment we leave this undefined and the XPath missing where we have a uniqueness test on Atomic Types. This function would allow us to fill in the missing XPath.

The definition of the function is: declare function fun:isUnique($arg as xs:anyAtomicType*) as xs:boolean (: Returns whether the list of atomic types contains any duplicated. If there are no duplicates then result is true. :) { count(distinct-values($arg)) eq count($arg) };

Notes:

  • matthewdr

    07/21/09 1:17 pm

    Discussed at the VWG. Agreed to add this as a function.

  • lyteck

    07/23/09 7:25 pm

    created function is-unique() (to be consistent with existing naming convention)

    updated 4.6 (trunk) and 5.0 branch

  • matthewdr

    07/28/09 11:30 am

    What was entered was:

    “Returns whether the list of atomic types contains any duplicate. If there are no duplicates then result is true.

    * parameter: $arg (XPath expression)

    * result: true/false (xsd:boolean)

    * test: count(distinct-values($arg)) eq count($arg)

    What should have been entered is:

    Returns whether the list of atomic types contains any duplicates. If there are no duplicates then result is true.

    * parameter: $arg (xs:anyAtomicType*)

    * result: true/false (xsd:boolean)

    * test: count(distinct-values($arg)) eq count($arg)

    Two changes:
    1. “duplicate” should be “duplicates” in English.
    2. xs:anyAtomicType* is not the same as an XPath Expression. It means any number of any atomic values.

    Please correct

  • matthewdr

    07/28/09 11:32 am

    Reopening because the fix was not what was agreed by the VWG and the fix is incorrect.

  • lyteck

    07/28/09 12:58 pm

    corrected function as suggested

  • matthewdr

    07/28/09 1:05 pm

    Closed after testing.

  • Leave an update

    You must be logged in to post an update.