FpML Issues Tracker

853: Some ird rules use contains() rather than exists()

September 18, 2008

closed

Minor

Always

Validation Rules

Admin

None

Summary

Some of the ird rules use the function "contains()" rather than "exists()".

In each case the usage shows that what is meant is exists() and not contains(). As per the FpML Validation Architecture, where a term is not defined we use the XPath2 definition.

Changing the contains() to exists() would bring the ird into line with the rest of FpML.

The rules this involves are: ird-23, ird-24, ird-30, and ird-31.

Notes:

  • lyteck

    10/01/08 1:42 pm

    ird-30 and ird-31 fixed (see 844)

    ird-23 & ird-24 maybe more difficult to reword. The pattern “XYZ element referenced by @ABC contains DEF” looses precision if reorganized as “XYZ is referenced by @ABC and XYZ/DEF exists” because the latter requires every XYZ/DEF to exist. Please propose a solution.

    Current:

    ird-23 (Mandatory)
    Context: StubCalculationPeriodAmount (complex type)
    iff(exist initialStub, calculationPeriodDates element referenced by calculationPeriodDates/@href contains at least one of:
    – firstPeriodStartDate
    – firstRegularPeriodStartDate
    )

    ird-24 (Mandatory)
    Context: StubCalculationPeriodAmount (complex type)
    iff(exist finalStub, calculationPeriodDates element referenced by calculationPeriodDates/@href contains a lastRegularPeriodEndDate element).

  • matthewdr

    10/01/08 1:59 pm

    ird-23 can be rewritten as:


    ird-23 (Mandatory)
    Context: StubCalculationPeriodAmount (complex type)
    iff(initialStub, id(calculationPeriodDates/@href)/(firstPeriodStartDate|firstRegularPeriodStartDate) exists)

    The id() function is built into XPath. As the FpML Validation Architecture says, we can accept the definition of XPath terms without redefinition.

  • lyteck

    10/07/08 8:32 pm

    implemented as suggested (as a result of 811 (use of Xpath) being approved)

    implemented as:

    ird-23 (Mandatory)
    Context: StubCalculationPeriodAmount (complex type)
    iff(exists(initialStub), exists(id(calculationPeriodDates/@href)/(firstPeriodStartDate | firstRegularPeriodStartDate)).

    Comment: initialStub exists if and only if the calculationPeriodDates element referenced by calculationPeriodDates/@href contains at least one of: firstPeriodStartDate, firstRegularPeriodStartDate

    ird-24 (Mandatory)
    Context: StubCalculationPeriodAmount (complex type)
    iff(exists(finalStub), exists(id(calculationPeriodDates/@href)/lastRegularPeriodEndDate).

    Comment: finalStub exists if and only if the calculationPeriodDates element referenced by calculationPeriodDates/@href contains a lastRegularPeriodEndDate element.

    (please check implementation, in particular the use of exists())

  • matthew

    10/07/08 9:15 pm

    Closing after testing.

  • Leave an update

    You must be logged in to post an update.