FpML 4.6 Validation Rules - Functions

This is the shared functions part of the validation rule set accompanying the FpML 4.6 Working Draft.

This section introduces functions as a mechanism to define repeatable tests that are applied independent of a context. Functions take node-element types as parameters and return a typed result.

Content

Namespace

default element namespace = http://www.fpml.org/2009/FpML-4-6

namespace xsd = http://www.w3.org/2001/XMLSchema

Functions

Function: ContractIdentifier-equal
The result is true where any $contractId1//element(*, ContractId) correlates to any $contractId2//element(*, ContractId). The comparison function for correlation is fpml:deep-equal().
Function: fpml:deep-equal
The fpml:deep-equal function returns true if the $parameter1 and $parameter2 sequences contain the same values, in the same order. Only elements in a current FpML namespace are considered. Atomic values are compared based on their typed values, using the eq operator. If two atomic values cannot be compared (e.g. because one is a number, and the other is a string), the function returns false rather than raise an error. Informally, two nodes are deep-equal if they have all the same attributes and have children (in the same order) who are themselves deep-equal.
Function: different-frequencies
All frequencies within the context of this rule must be different.
Function: iff
Return the logical "if and only if" of two xs:boolean operands. This is defined as (operand1 implies operand2) and (operand2 implies operand1). In simple terms, either both are true or neither is true.
Function: regular-period
The regular period of a set of calculation period dates is the period between a start date and an end date. If firstRegularPeriodStartDate exists, then the start date is firstRegularPeriodStartDate, else the start date is effectiveDate/unadjustedDate. If lastRegularPeriodEndDate exists, then the end date is lastRegularPeriodEndDate, else the end date is terminationDate/unadjustedDate.
Function: same-currency
All instances of currency values within the context of this rule must be identical.
Function: same-currency-scheme
All instances of currencyScheme URI values within the context of this rule must be identical.