80203: Function test xfi:v-equal

Documentation

Tests of function xfi:v-equal($left as node()*, $right as node()*) as xs:boolean

Owners

Name Affiliation Email Start End
Herm Fischer UBMatrix / Mark V Systems fischer@markv.com 19-02-2008 at 00:00:00

References

http://www.xbrl.org/Specification/XF-PWD-2006-12-07.htm#_Toc152670705

Test Case Variations


V-01 Returns v-equality of numeric items equal within precision and units

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-01a Returns v-equality of numeric items equal within precision and units (operands reversed from v-01)

Documentation

Tests that either left or right operand can be the "less precise" side.

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-02 Same as V-01 but numeric items not v-equal

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-03 Same as V-01 but arguments are sequences

Documentation

Inputs

  • schema: value-test-concepts.xsd
  • instance: value-test-instance.xml (DTS Discovery starting point) (ID=V03)
  • Function Call: xfi:v-equal( ( //concept:a[@id eq 't1'], //concept:a[@id eq 't4']), ( //concept:a[@id eq 't2'], //concept:a[@id eq 't5']) )

    (against file V03)

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-04 Same as V-01 but arguments are sequences not same length

Documentation

Inputs

  • schema: value-test-concepts.xsd
  • instance: value-test-instance.xml (DTS Discovery starting point) (ID=V04)
  • Function Call: xfi:v-equal( ( //concept:a[@id eq 't1'], //concept:a[@id eq 't4']), ( //concept:a[@id eq 't2'] ) )

    (against file V04)

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-05 Not a node argument to function

Documentation

XPath-defined error for node type incorrect.

Inputs

Outputs

  • Error code: xqt-err:XPTY0004

V-06 A sequence of concepts as argument

Documentation

XPath-defined error for node type incorrect arity of arguments.

Inputs

Outputs

  • Error code: xqt-err:XPST0017

V-07 Wrong node to function

Documentation

Functions spec error for non-item node type.

Inputs

Outputs

  • Error code: xfie:NodeIsNotXbrlItem

V-08 Returns v-equality of non-numeric items, unequal trim whitespace

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq true()

V-10 Returns v-equality of numerically equal but lexically different numeric and string items. Highlights a v-equality ambiguity.

Documentation

Bugzilla entry 325 relates to this. New-age DOMs (post-xdt) are not required to store string representations of object values, so a float may be converted to string in unrounded form, as shown here.

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-11 Returns v-equality of numerically equal but lexically different numeric and string items. String is locale-formatted here. Highlights a v-equality ambiguity.

Documentation

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-12 Returns v-equality of numerically equal but lexically different numeric and string items. String is locale-formatted here. Highlights a v-equality ambiguity.

Documentation

Bugzilla entry 325 relates to this. New-age DOMs (post-xdt) are not required to store string representations of object values, so a float may be converted to string in unrounded form, as shown here.

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-20 Returns v-equality of dateUnion deemed to be an instant date (such as a restated-on date). Highlights a v-equality shortcomming. Only compared lexically but if compared as instant date would be false anyway. A "post-modern" DOM (based on xdt) may find these two values equal if strings are recovered from binary dateTime objects, or raise XPTY0004 error if using XPath "=" or "eq" to compare incompatible date union member objects.

Documentation

Bugzilla entry 325 relates to this.

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-21 Returns v-equality of dateUnion deemed to be an instant date (such as a restated-on date). Highlights a v-equality shortcomming. Only compared lexically but if compared as instant date would be true.

Documentation

Bugzilla entry 325 relates to this.

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

V-22 Returns v-equality of dateUnion deemed to be an instant date (such as a restated-on date). Highlights a v-equality shortcomming. Only compared lexically but if compared as instant date would be true.

Documentation

Bugzilla entry 325 relates to this.

Inputs

Outputs

  • Result test: $result instance of xs:boolean and count( $result ) eq 1 and $result eq false()

Revisions

Name On Details
Herm Fischer 19-02-2008 at 00:00:00 Created the test case.
Herm Fischer 16-04-2008 at 10:00:00 Enhanced description of V-09. Added variations for numeric to non-numeric but numerically equal. Added variations for dateTimeItemType (date union) items. Added references to bugzilla entry 325 (regarding v-equals in spec).
Herm Fischer 05-02-2010 at 17:00:00 Vixed V-01 to have no whitespace around entity identifiers, as noted by IHR in e-mail 2010-02-05.