FpML 4.5 Validation Rules - Rules for Shared Elements

This is the shared element part of the validation rule set accompanying the FpML 4.5 Trial Recommendation. The introductory section in the draft contains background information and documentation for this page.

The rules contained on this page contain links to cut down versions of valid and invalid test cases. These test cases have been analysed using Systemwire's xlinkit rules to highlight relevant document portions accessed by a rule. These cut down test cases are non-normative and are provided for the purpose of documentation only.

Content

Namespace

default element namespace = http://www.fpml.org/2008/FpML-4-5

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

Functions

The following shared functions are used in the rules.

Rules

Unique contexts:

shared-1 (Mandatory)
English Description:
Context: BusinessDayAdjustments (complex type)
businessCentersReference or businessCenters must exist if and only if the value of businessDayConvention is not equal to "NONE" or "NotApplicable".
Formal Description:
Context: BusinessDayAdjustments (complex type)
iff(exists(businessCentersReference | businessCenters), not(businessDayConvention = ("NONE", "NotApplicable")))
Test cases: [Valid] [Valid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid] [Invalid]
shared-4 (Mandatory)
English Description:
Context: RelativeDateOffset (complex type)
If dayType equals to "Business", then the businessDayConvention must be equal to "NONE".
Formal Description:
Context: RelativeDateOffset (complex type)
[dayType eq "Business"]
businessDayConvention eq "NONE"
Test cases: [Valid] [Invalid]
shared-5 (Mandatory)
English Description:
Context: payerPartyReference
DirectionalLeg (complex type)
EquityPremium (complex type)
ExerciseFee (complex type)
ExerciseFeeSchedule (complex type)
FeaturePayment (complex type)
FxOptionPremium (complex type)
GrossCashflow (complex type)
IndependentAmount (complex type)
InitialPayment (complex type)
InterestRateStream (complex type)
PassThroughItem (complex type)
Payment (complex type)
PaymentBase (complex type)
PaymentMatching (complex type)
PrePayment (complex type)
PrincipalExchangeDescriptions (complex type)
QuotablePayment (complex type)
ReturnSwapAdditionalPayment (complex type)
ReturnSwapLeg (complex type)
SimplePayment (complex type)
payerPartyReference/@href must not be equal to receiverPartyReference/@href.
Formal Description:
Context: payerPartyReference
DirectionalLeg (complex type)
EquityPremium (complex type)
ExerciseFee (complex type)
ExerciseFeeSchedule (complex type)
FeaturePayment (complex type)
FxOptionPremium (complex type)
GrossCashflow (complex type)
IndependentAmount (complex type)
InitialPayment (complex type)
InterestRateStream (complex type)
PassThroughItem (complex type)
Payment (complex type)
PaymentBase (complex type)
PaymentMatching (complex type)
PrePayment (complex type)
PrincipalExchangeDescriptions (complex type)
QuotablePayment (complex type)
ReturnSwapAdditionalPayment (complex type)
ReturnSwapLeg (complex type)
SimplePayment (complex type)
payerPartyReference/@href ne receiverPartyReference/@href
Test cases: [Valid] [Invalid] [Invalid]
shared-6 (Mandatory)
English Description:
Context: AmericanExercise (complex type)
If latestExerciseTime exists, the earliestExerciseTime/hourMinuteTime must be before the latestExerciseTime/hourMinuteTime.
Formal Description:
Context: AmericanExercise (complex type)
[exists(latestExerciseTime)]
earliestExerciseTime/hourMinuteTime lt latestExerciseTime/hourMinuteTime
Test cases: [Valid] [Invalid] [Invalid]
shared-7 (Mandatory)
English Description:
Context: BermudaExercise (complex type)
If latestExerciseTime exists, the earliestExerciseTime/hourMinuteTime must be before the latestExerciseTime/hourMinuteTime.
Formal Description:
Context: BermudaExercise (complex type)
[exists(latestExerciseTime)]
earliestExerciseTime/hourMinuteTime lt latestExerciseTime/hourMinuteTime
Test cases: [Valid] [Valid] [Invalid]
shared-8 (Mandatory)
English Description:
Context: DateRange (complex type)
unadjustedFirstDate must be before unadjustedLastDate.
Formal Description:
Context: DateRange (complex type)
unadjustedFirstDate lt unadjustedLastDate
Test cases: [Valid] [Valid] [Invalid] [Invalid] [Invalid]
shared-9 (Mandatory)
English Description:
Context: BusinessDateRange (complex type)
If and only if neither businessCentersReference nor businessCenters exists, businessDayConvention must be equal to "NONE" or "NotApplicable".
Formal Description:
Context: BusinessDateRange (complex type)
iff(not(exists(businessCentersReference | businessCenters)), businessDayConvention = ("NONE", "NotApplicable"))
Test cases: [Valid] [Valid] [Invalid]
shared-10 (Mandatory)
English Description:
Context: CalculationAgent
The values of calculationAgentPartyReference/@href attributes shall be unique.
Test cases: [Valid] [Valid] [Invalid]
shared-11 (Mandatory)
English Description:
Context: Trade (complex type)
If businessDateRange exists within any descendant element of the trade, then businessCentersReference/@href, if present in any descendant element of the trade, must match some businessCenters/@id within any descendant of the same trade.
Formal Description:
Context: Trade (complex type)
[exists(//businessDateRange)]
Every $businessCentersReference in //businessCentersReference satisfies $businessCentersReference/@href eq //businessCenters/@id
Test cases: [Valid] [Valid] [Invalid]
shared-12 (Mandatory)
English Description:
Context: Document (complex type)
For buyerPartyReference anywhere in the document, @href shall match the @id attribute of a party element or the @id attribute of a tradeSide element.
Formal Description:
Context: Document (complex type)
For buyerPartyReference anywhere in the document, @href shall match the @id attribute of a party element or the @id attribute of a tradeSide element.
Test cases: [Valid] [Invalid]
shared-13 (Mandatory)
English Description:
Context: Document (complex type)
For sellerPartyReference anywhere in the document, @href shall match the @id attribute of a party element or the @id attribute of a tradeSide element.
Formal Description:
Context: Document (complex type)
Every $sellerPartyReference in //sellerPartyReference satisfies $sellerPartyReference/@href eq (trade/tradeSide, party)/@id
Test cases: [Valid] [Invalid]
shared-14 (Mandatory)
English Description:
Context: Document (complex type)
For calculationAgentPartyReference/@href anywhere in the document, @href shall match the @id attribute of a party element.
Formal Description:
Context: Document (complex type)
Every $calculationAgentPartyReference in //calculationAgentPartyReference satisfies $calculationAgentPartyReference/@href eq party/@id
Test cases: [Valid] [Invalid]
shared-15 (Mandatory)
English Description:
Context: Offset (complex type)
dayType must only exist if and only if period is "D" and periodMultiplier is non-zero.
Formal Description:
Context: Offset (complex type)
[exists(dayType)]
iff((period eq "D"), (offset/periodMultiplier ne 0))
Test cases: [Valid] [Invalid] [Invalid]
shared-16 (Mandatory)
English Description:
Context: Document (complex type)
If trade exists, for party/@href anywhere within the tradeSide element, @href shall match the @id attribute of an /FpML/party element.
Formal Description:
Context: Document (complex type)
[exists(trade)]
every $party in trade/tradeSide/*/party satisfies $party/@href eq party/@id
shared-17 (Mandatory)
English Description:
Context: Document (complex type)
If trade exists, for account/@href anywhere within the tradeSide element, @href shall match the @id attribute of an /FpML/party/account element.
Formal Description:
Context: Document (complex type)
[exists(trade)]
Every $account in trade/tradeSide/*/account satisfies $account/@href eq party/account/@id
shared-18 (Mandatory)
English Description:
Context: AcceptQuote (complex type)
AllocationAmended (complex type)
AllocationCancelled (complex type)
AllocationCreated (complex type)
AmendmentConfirmed (complex type)
CancelTradeCashflows (complex type)
CancelTradeConfirmation (complex type)
CancelTradeMatch (complex type)
ConfirmationCancelled (complex type)
ConfirmTrade (complex type)
ContractCreated (complex type)
ContractFullTermination (complex type)
ContractFullTerminationCancelled (complex type)
ContractIncreased (complex type)
ContractIncreasedCancelled (complex type)
ContractNovated (complex type)
ContractNovatedCancelled (complex type)
ContractPartialTermination (complex type)
ContractPartialTerminationCancelled (complex type)
ContractReferenceMessage (complex type)
CreditEventNotification (complex type)
DataDocument (complex type)
DrawdownNotice (complex type)
IncreaseConfirmed (complex type)
InterestPaymentNotice (complex type)
ModifyTradeConfirmation (complex type)
ModifyTradeMatch (complex type)
NovationMessage.model
OneOffFeeNotice (complex type)
OnGoingFeeNotice (complex type)
PositionReport (complex type)
PositionsAcknowledged (complex type)
PositionsAsserted (complex type)
PositionsMatchResults (complex type)
Quote (complex type)
QuoteAcceptanceConfirmed (complex type)
QuoteUpdated (complex type)
RepaymentConfirmationNotice (complex type)
RepaymentNotice (complex type)
RequestAllocation (complex type)
RequestAmendmentConfirmation (complex type)
RequestIncreaseConfirmation (complex type)
RequestPortfolio (complex type)
RequestPositionReport (complex type)
RequestQuote (complex type)
RequestQuoteResponse (complex type)
RequestTerminationConfirmation (complex type)
RequestTradeConfirmation (complex type)
RequestTradeMatch (complex type)
RequestTradeStatus (complex type)
RequestValuationReport (complex type)
TerminationConfirmed (complex type)
TradeAffirmation (complex type)
TradeAffirmed (complex type)
TradeAlleged (complex type)
TradeAlreadyMatched (complex type)
TradeAlreadySubmitted (complex type)
TradeAmended (complex type)
TradeAmendmentRequest (complex type)
TradeAmendmentResponse (complex type)
TradeCancelled (complex type)
TradeCashflowsAsserted (complex type)
TradeCashflowsMatchResult (complex type)
TradeConfirmed (complex type)
TradeCreated (complex type)
TradeErrorResponse (complex type)
TradeExecution (complex type)
TradeExecutionCancelled (complex type)
TradeExecutionModified (complex type)
TradeIncreaseRequest (complex type)
TradeIncreaseResponse (complex type)
TradeMatched (complex type)
TradeMismatched (complex type)
TradeNotFound (complex type)
TradeStatus (complex type)
TradeTerminationRequest (complex type)
TradeTerminationResponse (complex type)
TradeUnmatched (complex type)
ValuationReport (complex type)
Each party/partyId must be unique. Each party/partyName must be unique.
Comment: Both a party's name and party Id must be unique. The partyIdScheme is part of the partyId uniqueness check.
shared-19 (Mandatory)
English Description:
Context: AcceptQuote (complex type)
AllocationAmended (complex type)
AllocationCancelled (complex type)
AllocationCreated (complex type)
AmendmentConfirmed (complex type)
CancelTradeCashflows (complex type)
CancelTradeConfirmation (complex type)
CancelTradeMatch (complex type)
ConfirmationCancelled (complex type)
ConfirmTrade (complex type)
ContractCreated (complex type)
ContractFullTermination (complex type)
ContractFullTerminationCancelled (complex type)
ContractIncreased (complex type)
ContractIncreasedCancelled (complex type)
ContractNovated (complex type)
ContractNovatedCancelled (complex type)
ContractPartialTermination (complex type)
ContractPartialTerminationCancelled (complex type)
ContractReferenceMessage (complex type)
CreditEventNotification (complex type)
DataDocument (complex type)
DrawdownNotice (complex type)
IncreaseConfirmed (complex type)
InterestPaymentNotice (complex type)
ModifyTradeConfirmation (complex type)
ModifyTradeMatch (complex type)
NovationMessage.model
OneOffFeeNotice (complex type)
OnGoingFeeNotice (complex type)
PositionReport (complex type)
PositionsAcknowledged (complex type)
PositionsAsserted (complex type)
PositionsMatchResults (complex type)
Quote (complex type)
QuoteAcceptanceConfirmed (complex type)
QuoteUpdated (complex type)
RepaymentConfirmationNotice (complex type)
RepaymentNotice (complex type)
RequestAllocation (complex type)
RequestAmendmentConfirmation (complex type)
RequestIncreaseConfirmation (complex type)
RequestPortfolio (complex type)
RequestPositionReport (complex type)
RequestQuote (complex type)
RequestQuoteResponse (complex type)
RequestTerminationConfirmation (complex type)
RequestTradeConfirmation (complex type)
RequestTradeMatch (complex type)
RequestTradeStatus (complex type)
RequestValuationReport (complex type)
TerminationConfirmed (complex type)
TradeAffirmation (complex type)
TradeAffirmed (complex type)
TradeAlleged (complex type)
TradeAlreadyMatched (complex type)
TradeAlreadySubmitted (complex type)
TradeAmended (complex type)
TradeAmendmentRequest (complex type)
TradeAmendmentResponse (complex type)
TradeCancelled (complex type)
TradeCashflowsAsserted (complex type)
TradeCashflowsMatchResult (complex type)
TradeConfirmed (complex type)
TradeCreated (complex type)
TradeErrorResponse (complex type)
TradeExecution (complex type)
TradeExecutionCancelled (complex type)
TradeExecutionModified (complex type)
TradeIncreaseRequest (complex type)
TradeIncreaseResponse (complex type)
TradeMatched (complex type)
TradeMismatched (complex type)
TradeNotFound (complex type)
TradeStatus (complex type)
TradeTerminationRequest (complex type)
TradeTerminationResponse (complex type)
TradeUnmatched (complex type)
ValuationReport (complex type)
Each party/account/accountId must be unique. An account is identified by party/account/accountId or by party/account/accountName
Comment: Both an account's name and account Id must be unique. The accountIdScheme is part of the accountId uniqueness check.
shared-20 (Mandatory)
English Description:
Context: AdjustableDates (complex type)
Each unadjustedDate must be distinct.
shared-21 (Mandatory)
English Description:
Context: BusinessCenters (complex type)
Each businessCenter must be unique. A business center is identified by businessCenter.
Comment: Each business centre must be uniquely identified. The businessCenterScheme is part of the businessCenter uniqueness check.
shared-22 (Mandatory)
English Description:
Context: CalculationAgent (complex type)
Each calculationAgentPartyReference/@href must be unique
Comment: Each party needs only be referenced once as a calculation agent.
shared-23 (Mandatory)
English Description:
Context: CashSettlementReferenceBanks (complex type)
Each referenceBank must be unique. A referenceBank is identified by referenceBank/referenceBankId or by referenceBank/referenceBankName
Comment: Both a reference bank's name and reference bank Id must be unique. The referenceBankIdScheme is part of the referenceBankId uniqueness check.
shared-24 (Mandatory)
English Description:
Context: RoutingIds (complex type)
Each routingId must be unique
Comment: Each routing Id must be unique. The routingIdCodeScheme is part of the RoutingId uniqueness check.
shared-25 (Mandatory)
English Description:
Context: Schedule (complex type)
If there is more than one step, step/stepDate must be unique.
shared-26 (Mandatory)
English Description:
Context: Bond (complex type)
The currency of the parValue is the currency element. When the parValue exists therefore the currency must also exist. This is a workaround because parValue is not defined as a Money type.
Formal Description:
Context: Bond (complex type)
[exists(parValue)]
exists(currency)
shared-27 (Mandatory)
English Description:
Context: Document (complex type)
All timezones must be the same. +00:00, -00:00, and Z are considered equivalent.
Formal Description:
Context: Document (complex type)
count(distinct-values(//((element(*, xs:date)|attribute(*, xs:date))/timezone-from-date(.),(element(*, xs:dateTime)|attribute(*, xs:dateTime))/timezone-from-dateTime(.)))) eq 1
Comment: This rule ensures that date and datetime comparisons behave as expected because they're expressed in the same timezone. NB That the XSD specification uses the term "timezone", but that they are not really timezones as they are fixed durations to represent time offsets. Subsequent to publishing XSD the W3C changed its position to clarify this: http://www.w3.org/TR/2005/NOTE-timezone-20051013/#d2e226.
shared-28 (Mandatory)
English Description:
Context: Document (complex type)
All dates and times must have a timezone or none of them must.
Formal Description:
Context: Document (complex type)
count(//((element(*, xs:date)|attribute(*, xs:date))/timezone-from-date(.),(element(*, xs:dateTime)|attribute(*, xs:dateTime))/timezone-from-dateTime(.))) eq count(//(element(*, xs:date)|attribute(*, xs:date),element(*, xs:dateTime)|attribute(*, xs:dateTime)))
Comment: This rule requires all dates and datetimes to have timezones or none of them must. This is to ensure the comparison of these fields behaves as expected. NB That the XSD specification uses the term "timezone", but that they are not really timezones as they are fixed durations to represent time offsets. Subsequent to publishing XSD the W3C changed its position to clarify this: http://www.w3.org/TR/2005/NOTE-timezone-20051013/#d2e226.

Deprecated rules

Removed rules

shared-2 (Mandatory)
REMOVED: Context: Offset; Description: If the dayType element exists then the period must be "D".
shared-3 (Mandatory)
REMOVED: Context: Offset; Description: If the dayType is "Business" then the periodMultiplier must be non-zero.