FpML 4.0 Validation Rules - CLiX Reference Implementation
This is the CLiX reference
implementation of the FpML validation rule set
http://www.fpml.org/2003/FpML-4-0/validation/2004-04-02. The CLiX rules
on this page are ©2004 Systemwire Ltd. and their viewing and use is subject
to the license set out below. The remaining English language rules
are ©2003-04 International Swaps and Derivatives Association
(ISDA) and subject to the
FpML Public License.
In order to view a rule, simply click on the "CLiX rule" link and a
rendered version will pop up in a little frame. The linked test case fragments have
been generated using xlinkit, by using the rule to highlight relevant parts of
the documents. Information on where to find the full reference implementation in its
XML format can be found on the main Systemwire
FpML page.
License
The rules made available on this page are in the public domain. You may
freely modify and redistribute them, as long as Systemwire is clearly and visibly
identified as the copyright holder.
Disclaimer
SINCE THE INFORMATION ON THIS PAGE IS PROVIDED FOR NO FEE, IT IS PROVIDED "AS IS"
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION,
THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
SYSTEMWIRE CANNOT BE HELD RESPONSIBLE FOR ANY INTENDED OR UNINTENDED DAMAGES
ARISING FROM THE USE OF THE INFORMATION CONTAINED ON THIS PAGE.
Unique contexts:
Context:
BusinessDayAdjustments (data type)
shared-1 (Mandatory)
businessCentersReference or
businessCenters must be present if and only if the value of
businessDayConvention is not equal to
NONE or NotApplicable.
forall businessDayAdjustment in $BusinessDayAdjustments
(
exists ref in $businessDayAdjustment/fpml:businessCenters or
exists ref in $businessDayAdjustment/fpml:businessCentersReference)
if and only if
(
$businessDayAdjustment/fpml:businessDayConvention != 'NONE' and
$businessDayAdjustment/fpml:businessDayConvention != 'NotApplicable')
[hide me!] clix rule | Test cases:
[Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid]
Context:
RelativeDateOffset (data type)
shared-4 (Mandatory)
If the dayType is Business then the
businessDayConvention should be NONE.
forall offset in $RelativeDateOffsets$offset/fpml:dayType = 'Business' implies
$offset/fpml:businessDayConvention = 'NONE' [hide me!] clix rule | Test cases:
[Valid] [Invalid]
Context:
payerPartyReference
shared-5 (Mandatory)
If ../receiverPartyReference is present, then the @href
attributes of the two elements must not be equal.
forall payerPartyReference in //fpml:payerPartyReferenceforall receiverPartyReference in $payerPartyReference/../fpml:receiverPartyReference$payerPartyReference/@href != $receiverPartyReference/@href
[hide me!] clix rule | Test cases:
[Valid] [Invalid] [Invalid]
Context:
AmericanExercise (data type)
shared-6 (Mandatory)
earliestExerciseTime <
latestExerciseTime, if
latestExerciseTime exists.
forall americanExercise in //fpml:americanExerciseexists latest in $americanExercise/fpml:latestExerciseTime implies
$americanExercise/fpml:earliestExerciseTime/fpml:hourMinuteTime < $americanExercise/fpml:latestExerciseTime/fpml:hourMinuteTime [hide me!] clix rule | Test cases:
[Valid] [Invalid] [Invalid]
Context:
BermudaExercise (data type)
shared-7 (Mandatory)
earliestExerciseTime <
latestExerciseTime, if
latestExerciseTime exists.
forall bermudaExercise in //fpml:bermudaExerciseexists latest in $bermudaExercise/fpml:latestExerciseTime implies
$bermudaExercise/fpml:earliestExerciseTime/fpml:hourMinuteTime < $bermudaExercise/fpml:latestExerciseTime/fpml:hourMinuteTime [hide me!] clix rule | Test cases:
[Valid] [Valid] [Invalid]
Context:
DateRange (data type)
shared-8 (Mandatory)
unadjustedFirstDate < unadjustedLastDate.
forall dateRange in //fpml:scheduleBounds | //fpml:cashSettlementPaymentDate/fpml:businessDateRange$dateRange/fpml:unadjustedFirstDate < $dateRange/fpml:unadjustedLastDate
[hide me!] clix rule | Test cases:
[Valid] [Valid] [Invalid] [Invalid] [Invalid]
Context:
BusinessDateRange (data type)
shared-9 (Mandatory)
businessDayConvention is
NONE or NotApplicable if and only if neither
businessCentersReference nor
businessCenters is present.
forall businessDateRange in //fpml:cashSettlementPaymentDate/fpml:businessDateRange
(
exists ref in $businessDateRange/fpml:businessCenters or
exists ref in $businessDateRange/fpml:businessCentersReference)
if and only if
(
$businessDateRange/fpml:businessDayConvention != 'NONE' and
$businessDateRange/fpml:businessDayConvention != 'NotApplicable')
[hide me!] clix rule | Test cases:
[Valid] [Valid] [Invalid]
Context:
calculationAgent
shared-10 (Mandatory)
The values of calculationAgentPartyReference/@href attributes shall be unique.
forall calculationAgent in //fpml:calculationAgentmacro:unique(list=$calculationAgent/fpml:calculationAgentPartyReference,id=@href)
[hide me!] clix rule | Test cases:
[Valid] [Valid] [Invalid]
Context:
Trade (data type)
shared-11 (Mandatory)
If businessDateRange exists within any descendant element of the trade, then
businessCentersReference/@href, if present, must match some
businessCenters/@id within the same trade.
forall trade in //fpml:FpML/fpml:tradeforall businessDateRange in $trade//fpml:businessDateRangeexists ref in $businessDateRange/fpml:businessCentersReference implies
exists centers in $trade//fpml:businessCenters$businessDateRange/fpml:businessCentersReference/@href = $centers/@id
[hide me!] clix rule | Test cases:
[Valid] [Valid] [Invalid]
Context:
FpML
shared-12 (Mandatory)
For buyerPartyReference anywhere in the document, @href shall match
the @id attribute of a party element.
forall fpml in //fpml:FpMLforall buyerPartyReference in $fpml//fpml:buyerPartyReferenceexists party in $fpml/fpml:party$buyerPartyReference/@href = $party/@id
[hide me!] clix rule | Test cases:
[Valid] [Invalid]
shared-13 (Mandatory)
For sellerPartyReference anywhere in the document, @href shall match
the @id attribute of a party element.
forall fpml in //fpml:FpMLforall sellerPartyReference in $fpml//fpml:sellerPartyReferenceexists party in $fpml/fpml:party$sellerPartyReference/@href = $party/@id
[hide me!] clix rule | Test cases:
[Valid] [Invalid]
shared-14 (Mandatory)
For calculationAgentPartyReference/@href anywhere in the document, href
shall match the @id attribute of a party element.
forall fpml in //fpml:FpMLforall agentPartyReference in $fpml//fpml:calculationAgentPartyReferenceexists party in $fpml/fpml:party$agentPartyReference/@href = $party/@id
[hide me!] clix rule | Test cases:
[Valid] [Invalid]
Context:
Offset (data type)
shared-15 (Mandatory)
dayType must only be present if and only if period is
D and periodMultiplier is non-zero.
forall offset in $Offsetsexists daytype in $offset/fpml:dayType if and only if
(
$offset/fpml:period = 'D' and
number($offset/fpml:periodMultiplier) != 0)
[hide me!] clix rule | Test cases:
[Valid] [Invalid] [Invalid]
Deprecated rules