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
48 changes: 48 additions & 0 deletions .github/EXAMPLE_README_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
Example README template — copy into each example directory and fill in.
Keep it scannable. All content in English.
-->
# <Component> — <Short Title>

![Version](https://img.shields.io/badge/FundsXML-<X.Y.Z>-blue) ![status](https://img.shields.io/badge/status-runnable-brightgreen)

| Property | Value |
|----------|-------|
| **What** | One sentence: what this example demonstrates |
| **FundsXML version(s)** | e.g. 4.2.9 (works on 4.1.0/4.0.0 too — note differences) |
| **Validated against** | `https://github.com/fundsxml/schema/releases/download/<X.Y.Z>/FundsXML.xsd` |
| **Stacks** | CLI / Python / Java / .NET / PowerShell (list what is provided) |

## Purpose

Why this exists and when an enterprise integrator would use it.

## Prerequisites

- Tooling/runtime versions
- `tools/fetch-schema.sh <version>` if schema is needed
- Network/proxy note when the official schema URL must be reached

## Run

Provide a runnable command per applicable stack:

```bash
# CLI
...
```
```bash
# Python
...
```
<!-- Java / .NET / PowerShell as applicable -->

## Expected output

What a correct run produces (and what failure looks like).

## Troubleshooting

| Symptom | Cause | Fix |
|---------|-------|-----|
| ... | ... | ... |
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: FundsXML CI

# Validates every committed sample against the official released XSD and the
# Schematron ruleset, runs the XSLT transforms as a smoke test, and asserts the
# negative fixtures still fail. Positive samples must stay green.
#
# Security note: no untrusted GitHub event data (issue/PR/commit text) is used
# in any run: step, so there is no workflow-injection surface here.

on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install tooling
run: sudo apt-get update -qq && sudo apt-get install -y -qq libxml2-utils xsltproc

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Fetch official schemas (4.2.9, 4.1.0, 4.0.0)
run: |
for v in 4.2.9 4.1.0 4.0.0; do tools/fetch-schema.sh "$v"; done

- name: XSD - all positive samples must validate
run: |
set -e
declare -A S=(
["4.2.9"]="positions/Mixed-Fund_Positions transactions/Fund_Transactions documents/Fund_Documents regulatory/EFT_Regulatory signed/Signed_Fund_Skeleton"
["4.1.0"]="positions/Equity-Fund_Positions"
["4.0.0"]="positions/Equity-Fund_Positions"
)
for v in "${!S[@]}"; do
for f in ${S[$v]}; do
echo "XSD $v/$f"
xmllint --noout --nonet --schema ".schema-cache/$v/FundsXML.xsd" \
"FundsXML_Files/$v/$f.xml"
done
done

- name: XSD - negative fixture must FAIL
run: |
if xmllint --noout --nonet --schema .schema-cache/4.2.9/FundsXML.xsd \
tests/fixtures/invalid/xsd-invalid_Positions.xml 2>/dev/null; then
echo "::error::xsd-invalid fixture unexpectedly validated"; exit 1
fi
echo "xsd-invalid correctly rejected"

- name: Fetch Java toolchain (Saxon + SchXslt)
run: tools/fetch-tools.sh

- name: Schematron - canonical sample passes, fixture fails
run: |
RS=Schematron_DataQuality_Checks/Basic_Checks/invocation/run-schematron.sh
"$RS" FundsXML_Files/4.2.9/positions/Mixed-Fund_Positions.xml
if "$RS" tests/fixtures/invalid/schematron-invalid_Positions.xml; then
echo "::error::schematron-invalid fixture unexpectedly passed"; exit 1
fi
echo "schematron-invalid correctly failed"

- name: Smoke - XSLT transforms produce non-empty output
run: |
set -e
RT=XSLT_Transformations/invocation/run-transform.sh
SRC=FundsXML_Files/4.2.9/positions/Mixed-Fund_Positions.xml
"$RT" XSLT_DataQuality_Checks/Custom_Internal_Checks/custom_internal_checks.xslt "$SRC" out_dq.html
"$RT" XSLT_Transformations/Factsheet/factsheet_html.xslt "$SRC" out_fs.html
"$RT" XSLT_Transformations/Factsheet/factsheet_fo.xslt "$SRC" out_fs.fo
"$RT" XSLT_Transformations/CSV_Export/positions_csv.xslt "$SRC" out_pos.csv
xmllint --noout out_fs.fo
for f in out_dq.html out_fs.html out_pos.csv; do
test -s "$f" || { echo "::error::$f is empty"; exit 1; }
done
test "$(wc -l < out_pos.csv)" -ge 2

- name: Regression - legacy XSLT 1.0 report still runs
run: |
xsltproc XSLT_DataQuality_Checks/Enhanced_Check/FundsXML_CompleteDQReport_HTML.xsl \
FundsXML_Files/4.2.9/positions/Mixed-Fund_Positions.xml > out_enh.html
test -s out_enh.html
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
CLAUDE.md

# Locally fetched XSD releases (via tools/fetch-schema.sh) — not committed,
# the source of truth is the official GitHub release.
.schema-cache/

# Locally fetched Java toolchain jars (via tools/fetch-tools.sh) — external
# dependencies from Maven Central, not repo source.
.lib/

# Generated reports / outputs
*.report.html
report.html
full_report.html
validation_report.xml
out/
out_*.html
out_*.fo
out_*.csv
*.svrl
164 changes: 164 additions & 0 deletions FundsXML_Files/4.0.0/positions/Equity-Fund_Positions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- FundsXML 4.0.0 — compact equity-fund positions example.
FundsXML is backward compatible: the same structure also validates against
newer releases. NOTE for 4.0.0: ControlData has NO <Version> element
(introduced in 4.1.0). The version here is visible via
xsi:noNamespaceSchemaLocation and this comment. -->
<FundsXML4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://github.com/fundsxml/schema/releases/download/4.0.0/FundsXML.xsd">
<ControlData>
<UniqueDocumentID>FUNDSXML_400_POS_1</UniqueDocumentID>
<DocumentGenerated>2024-06-28T00:00:00</DocumentGenerated>
<ContentDate>2024-06-28</ContentDate>
<DataSupplier>
<SystemCountry>AT</SystemCountry>
<Short>EURAM</Short>
<Name>Erste Asset Management GmbH</Name>
<Type>Asset Manager</Type>
</DataSupplier>
<DataOperation>INITIAL</DataOperation>
</ControlData>
<Funds>
<Fund>
<Identifiers>
<LEI>529900T8BM49AURSDO55</LEI>
</Identifiers>
<Names>
<OfficialName>Erste Equity Europe Classic</OfficialName>
</Names>
<Currency>EUR</Currency>
<SingleFundFlag>true</SingleFundFlag>
<FundDynamicData>
<TotalAssetValues>
<TotalAssetValue>
<NavDate>2024-06-28</NavDate>
<TotalAssetNature>OFFICIAL</TotalAssetNature>
<TotalNetAssetValue>
<Amount ccy="EUR">40000000</Amount>
</TotalNetAssetValue>
</TotalAssetValue>
</TotalAssetValues>
<Portfolios>
<Portfolio>
<NavDate>2024-06-28</NavDate>
<Positions>
<Position>
<UniqueID>ID_001</UniqueID>
<Identifiers>
<ISIN>NL0010273215</ISIN>
</Identifiers>
<Currency>EUR</Currency>
<TotalValue>
<Amount ccy="EUR">16000000</Amount>
</TotalValue>
<TotalPercentage>40.00</TotalPercentage>
<Equity>
<Units>17000.00</Units>
<Price>
<Amount ccy="EUR">941.18</Amount>
</Price>
</Equity>
</Position>
<Position>
<UniqueID>ID_002</UniqueID>
<Identifiers>
<ISIN>FR0000120578</ISIN>
</Identifiers>
<Currency>EUR</Currency>
<TotalValue>
<Amount ccy="EUR">14000000</Amount>
</TotalValue>
<TotalPercentage>35.00</TotalPercentage>
<Equity>
<Units>140000.00</Units>
<Price>
<Amount ccy="EUR">100.00</Amount>
</Price>
</Equity>
</Position>
<Position>
<UniqueID>ID_003</UniqueID>
<Identifiers>
<ISIN>DE0007164600</ISIN>
</Identifiers>
<Currency>EUR</Currency>
<TotalValue>
<Amount ccy="EUR">10000000</Amount>
</TotalValue>
<TotalPercentage>25.00</TotalPercentage>
<Equity>
<Units>62500.00</Units>
<Price>
<Amount ccy="EUR">160.00</Amount>
</Price>
</Equity>
</Position>
</Positions>
</Portfolio>
</Portfolios>
</FundDynamicData>
</Fund>
</Funds>
<AssetMasterData>
<Asset>
<UniqueID>ID_001</UniqueID>
<Identifiers>
<ISIN>NL0010273215</ISIN>
</Identifiers>
<Currency>EUR</Currency>
<Country>NL</Country>
<Name>ASML HOLDING N.V.</Name>
<AssetType>EQ</AssetType>
<AssetDetails>
<Equity>
<Issuer>
<Identifiers>
<LEI>724500Y6P2B0MRLY2T56</LEI>
</Identifiers>
<Name>ASML HOLDING N.V.</Name>
</Issuer>
</Equity>
</AssetDetails>
</Asset>
<Asset>
<UniqueID>ID_002</UniqueID>
<Identifiers>
<ISIN>FR0000120578</ISIN>
</Identifiers>
<Currency>EUR</Currency>
<Country>FR</Country>
<Name>SANOFI S.A.</Name>
<AssetType>EQ</AssetType>
<AssetDetails>
<Equity>
<Issuer>
<Identifiers>
<LEI>549300E9PC51EN656011</LEI>
</Identifiers>
<Name>SANOFI S.A.</Name>
</Issuer>
</Equity>
</AssetDetails>
</Asset>
<Asset>
<UniqueID>ID_003</UniqueID>
<Identifiers>
<ISIN>DE0007164600</ISIN>
</Identifiers>
<Currency>EUR</Currency>
<Country>DE</Country>
<Name>SAP SE</Name>
<AssetType>EQ</AssetType>
<AssetDetails>
<Equity>
<Issuer>
<Identifiers>
<LEI>529900D6BF99LW9R2E68</LEI>
</Identifiers>
<Name>SAP SE</Name>
</Issuer>
</Equity>
</AssetDetails>
</Asset>
</AssetMasterData>
</FundsXML4>
33 changes: 33 additions & 0 deletions FundsXML_Files/4.0.0/positions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# FundsXML 4.0.0 — Equity-Fund Positions Example

![Version](https://img.shields.io/badge/FundsXML-4.0.0-blue) ![validated](https://img.shields.io/badge/XSD-valid-brightgreen)

| Property | Value |
|----------|-------|
| **File** | `Equity-Fund_Positions.xml` |
| **Schema version** | FundsXML 4.0.0 |
| **Validated against** | `https://github.com/fundsxml/schema/releases/download/4.0.0/FundsXML.xsd` |
| **Purpose** | Oldest supported release, version comparison |

## Contents

Content-identical to the 4.1.0 example (3 equity positions), but adapted to the
4.0.0 schema rules.

## Version differences (important!)

- ❗ **4.0.0 `ControlData` has NO `<Version>` element** — that was introduced in
4.1.0. The version here is only visible via `xsi:noNamespaceSchemaLocation`
and the header comment. An inserted `<Version>` would break validation
(`Element 'Version': This element is not expected`).
- The 4.0.0 release ships a self-contained `FundsXML.xsd`.
- Despite header differences, the positions/asset structure is stable across
versions (backward compatibility).

## Validation

```bash
tools/fetch-schema.sh 4.0.0
xmllint --noout --schema .schema-cache/4.0.0/FundsXML.xsd \
FundsXML_Files/4.0.0/positions/Equity-Fund_Positions.xml
```
Loading
Loading