Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions FundsXML_Files/4.2.9/positions/Mixed-Fund_Positions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,15 @@
<StrikePrice>
<Amount ccy="EUR">280</Amount>
</StrikePrice>
<Underlyings>
<Underlying>
<Type>Security</Type>
<Name>Allianz SE</Name>
<Identifiers>
<ISIN>DE0008404005</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Option>
</AssetDetails>
</Asset>
Expand All @@ -661,6 +670,15 @@
<StrikePrice>
<Amount ccy="EUR">85</Amount>
</StrikePrice>
<Underlyings>
<Underlying>
<Type>Security</Type>
<Name>Volkswagen AG (Vz)</Name>
<Identifiers>
<ISIN>DE0007664039</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Option>
</AssetDetails>
</Asset>
Expand All @@ -679,6 +697,15 @@
<ContractSize>10</ContractSize>
<MaturityDate>2025-12-19</MaturityDate>
<StockMarket>XEUR</StockMarket>
<Underlyings>
<Underlying>
<Type>Index</Type>
<Name>EURO STOXX 50 Index</Name>
<Identifiers>
<ISIN>EU0009658145</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Future>
</AssetDetails>
</Asset>
Expand All @@ -696,6 +723,15 @@
<ContractSize>125000</ContractSize>
<MaturityDate>2026-03-16</MaturityDate>
<StockMarket>XCME</StockMarket>
<Underlyings>
<Underlying>
<Type>Currency</Type>
<Name>EUR/USD</Name>
<Identifiers>
<OtherID>EURUSD</OtherID>
</Identifiers>
</Underlying>
</Underlyings>
</Future>
</AssetDetails>
</Asset>
Expand Down
18 changes: 17 additions & 1 deletion Schematron_DataQuality_Checks/Basic_Checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This directory contains comprehensive Schematron validation rules for FundsXML d
|----------|-------|
| **File** | `basic_checks.sch` |
| **Query Binding** | XSLT 2.0 (`queryBinding="xslt2"`) |
| **Patterns** | 9 validation patterns |
| **Patterns** | 11 validation patterns |
| **Total Rules** | 40+ assertions and reports |
| **Purpose** | Comprehensive FundsXML data quality validation |

Expand All @@ -25,6 +25,14 @@ direction rule). These were split into their own patterns —
document with percentages summing to 120 % now produces an ERROR; the canonical
sample (summing to 100 %) does not.

The same bug hid in `asset-validations`: the *Derivative Exposure* warning
rule (`OP or FU or FX or SW`) claimed every Option and Future first, so the
*Option Underlying* / *Future Underlying* ERROR rules never fired (SVRL listed
them as `svrl:suppressed-rule`). They now live in their own pattern,
`asset-underlying-validations`, and the canonical sample carries an
`Underlyings/Underlying` on each of its four options/futures so it still
passes with 0 errors.

Run it across stacks via [`invocation/`](invocation/) (CLI, native Java,
Python/saxonche, .NET). The canonical sample yields **0 errors + 12 advisory
warnings** (the broad `ShareClass` rule also matches `AssetDetails/ShareClass`;
Expand Down Expand Up @@ -84,6 +92,14 @@ Asset type-specific requirements based on the AssetType code.
| ISIN Required | EQ, BO, SC | ERROR | Equity, Bond, ShareClass assets must have ISIN |
| Counterparty ID | AC | WARNING | Account assets should have counterparty LEI or BIC |
| Derivative Exposure | OP, FU, FX, SW | WARNING | Derivatives should have exposure information |

### Pattern 4b: Derivative Underlyings (`asset-underlying-validations`)

Own pattern so these rules are not shadowed by the Derivative Exposure rule
above (see *Known ruleset fix*).

| Rule | Asset Types | Severity | Description |
|------|-------------|----------|-------------|
| Option Underlying | OP | ERROR | Options must have at least one underlying |
| Future Underlying | FU | ERROR | Futures must have at least one underlying |

Expand Down
12 changes: 12 additions & 0 deletions Schematron_DataQuality_Checks/Basic_Checks/basic_checks.sch
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,18 @@
</assert>
</rule>

</pattern>

<!-- ============================================
PATTERN 4b: DERIVATIVE UNDERLYINGS
Split out of asset-validations on purpose: ISO Schematron fires only
the FIRST rule whose context matches a node within a pattern. The
derivative-exposure rule above (OP or FU or FX or SW) already claims
every Option and Future, so these two ERROR rules were dead code
while they lived in the same pattern (SVRL showed them as
svrl:suppressed-rule). Same fix as percentage-validations.
============================================ -->
<pattern id="asset-underlying-validations">
<!-- Rule: Options must have underlying -->
<rule context="AssetMasterData/Asset[AssetType = 'OP']">
<assert test="AssetDetails/Option/Underlyings/Underlying" role="error">
Expand Down
10 changes: 7 additions & 3 deletions XSLT_DataQuality_Checks/Basic_Checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ Compares calculated price to reported price:

| Result | Difference | Status |
|--------|------------|--------|
| OK | < 0.1 | ✓ OK |
| ROUNDING | 0.1 - 1.0 | ⚠ ROUNDING |
| ERROR | ≥ 1.0 | ✗ ERROR |
| OK | < 0.01 | ✓ OK |
| ROUNDING | 0.01 - 0.1 | ⚠ ROUNDING |
| ERROR | ≥ 0.1 | ✗ ERROR |

These bands are identical to the Schematron `Price Calculation` / `Price
Rounding` rules in `Schematron_DataQuality_Checks/Basic_Checks/basic_checks.sch`;
change both together.

### 4. Portfolio Position Reconciliation

Expand Down
7 changes: 5 additions & 2 deletions XSLT_DataQuality_Checks/Basic_Checks/basic_checks.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,13 @@
<td class="number"><xsl:value-of select="format-number($diff, '#,##0.00')"/></td>
<td>
<xsl:choose>
<xsl:when test="abs($diff) &lt; 0.1">
<!-- Same bands as basic_checks.sch (price-calculation
rule): ERROR from 0.1, rounding warning 0.01-0.1.
Keep the two in sync (both READMEs document them). -->
<xsl:when test="abs($diff) &lt; 0.01">
<span class="check-passed">✓ OK</span>
</xsl:when>
<xsl:when test="abs($diff) &lt; 1">
<xsl:when test="abs($diff) &lt; 0.1">
<span class="warning">⚠ ROUNDING</span>
</xsl:when>
<xsl:otherwise>
Expand Down
36 changes: 36 additions & 0 deletions tests/fixtures/invalid/schematron-invalid_Positions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,15 @@
<StrikePrice>
<Amount ccy="EUR">280</Amount>
</StrikePrice>
<Underlyings>
<Underlying>
<Type>Security</Type>
<Name>Allianz SE</Name>
<Identifiers>
<ISIN>DE0008404005</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Option>
</AssetDetails>
</Asset>
Expand All @@ -661,6 +670,15 @@
<StrikePrice>
<Amount ccy="EUR">85</Amount>
</StrikePrice>
<Underlyings>
<Underlying>
<Type>Security</Type>
<Name>Volkswagen AG (Vz)</Name>
<Identifiers>
<ISIN>DE0007664039</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Option>
</AssetDetails>
</Asset>
Expand All @@ -679,6 +697,15 @@
<ContractSize>10</ContractSize>
<MaturityDate>2025-12-19</MaturityDate>
<StockMarket>XEUR</StockMarket>
<Underlyings>
<Underlying>
<Type>Index</Type>
<Name>EURO STOXX 50 Index</Name>
<Identifiers>
<ISIN>EU0009658145</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Future>
</AssetDetails>
</Asset>
Expand All @@ -696,6 +723,15 @@
<ContractSize>125000</ContractSize>
<MaturityDate>2026-03-16</MaturityDate>
<StockMarket>XCME</StockMarket>
<Underlyings>
<Underlying>
<Type>Currency</Type>
<Name>EUR/USD</Name>
<Identifiers>
<OtherID>EURUSD</OtherID>
</Identifiers>
</Underlying>
</Underlyings>
</Future>
</AssetDetails>
</Asset>
Expand Down
36 changes: 36 additions & 0 deletions tests/fixtures/invalid/xsd-invalid_Positions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,15 @@
<StrikePrice>
<Amount ccy="EUR">280</Amount>
</StrikePrice>
<Underlyings>
<Underlying>
<Type>Security</Type>
<Name>Allianz SE</Name>
<Identifiers>
<ISIN>DE0008404005</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Option>
</AssetDetails>
</Asset>
Expand All @@ -661,6 +670,15 @@
<StrikePrice>
<Amount ccy="EUR">85</Amount>
</StrikePrice>
<Underlyings>
<Underlying>
<Type>Security</Type>
<Name>Volkswagen AG (Vz)</Name>
<Identifiers>
<ISIN>DE0007664039</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Option>
</AssetDetails>
</Asset>
Expand All @@ -679,6 +697,15 @@
<ContractSize>10</ContractSize>
<MaturityDate>2025-12-19</MaturityDate>
<StockMarket>XEUR</StockMarket>
<Underlyings>
<Underlying>
<Type>Index</Type>
<Name>EURO STOXX 50 Index</Name>
<Identifiers>
<ISIN>EU0009658145</ISIN>
</Identifiers>
</Underlying>
</Underlyings>
</Future>
</AssetDetails>
</Asset>
Expand All @@ -696,6 +723,15 @@
<ContractSize>125000</ContractSize>
<MaturityDate>2026-03-16</MaturityDate>
<StockMarket>XCME</StockMarket>
<Underlyings>
<Underlying>
<Type>Currency</Type>
<Name>EUR/USD</Name>
<Identifiers>
<OtherID>EURUSD</OtherID>
</Identifiers>
</Underlying>
</Underlyings>
</Future>
</AssetDetails>
</Asset>
Expand Down