Skip to content

refactor(xsd): validators take <schema> <xml-file>, drop version-based resolution#21

Merged
karlkauc merged 2 commits into
mainfrom
refactor/xsd-validate-schema-arg
May 18, 2026
Merged

refactor(xsd): validators take <schema> <xml-file>, drop version-based resolution#21
karlkauc merged 2 commits into
mainfrom
refactor/xsd-validate-schema-arg

Conversation

@karlkauc

Copy link
Copy Markdown
Contributor

What & why

The six XSD validators previously took a FundsXML <version> and auto-resolved the official schema via a 3-step chain ($FUNDSXML_SCHEMA_DIR.schema-cache/<version>/ → download the GitHub release by version). Per request, the validators now take exactly a schema and an XML file and produce a validation report — no version, no env var, no cache, no resolver module. The schema argument is a local path or a remote URL (e.g. the official release). Argument order is schema-first, matching the existing Schematron/XSLT/XQuery invocations.

Changes

  • All 6 validators (cli/validate.sh, cli/validate.ps1, python/validate.py, java/XsdValidate.java, dotnet/XsdValidate.cs, powershell/Validate-FundsXml.ps1): new <schema> <xml-file> contract; exit 0/1/2; report prints … (schema <arg>).
  • Deleted tools/fundsxml_schema.py and XSD_Validation/dotnet/SchemaResolver.cs. pyproject.toml is now dependency-only (py-modules = []); .schema-cache/ removed from .gitignore.
  • URL handling: Python / CLI-sh / CLI-ps1-with-xmllint / Java fetch the schema (and the relative xmldsig-core-schema.xsd sibling 4.2.9+ imports) into a temp dir, then validate locally — instance XXE-hardening (--nonet, no DTD/entities) unchanged. .NET and PowerShell Validate-FundsXml.ps1 resolve a URL natively via XmlUrlResolver. (The GitHub release 302-redirects to an opaque blob URL, so a relative import can't be resolved post-redirect — hence the temp fetch for the simple-HTTP stacks.)
  • CI: dropped the fundsxml_schema precache; plain-curl the official schemas into ci-schemas/ for the raw-xmllint steps; validator steps now pass a schema and additionally exercise the remote-URL path on every stack (Linux) / via the release URL (Windows).
  • Docs: CLAUDE.md, root + XSD_Validation + per-area/per-version READMEs, CONTRIBUTING.md, .github templates rewritten for the new contract.

Generators — reviewed, intentionally unchanged

Large_File_Processing, Data_Binding_JSON, Database_Integration export embed the 4.2.9 release URL only as the xsi:noNamespaceSchemaLocation label on generated output — not schema resolution. Left as-is by design; that URL is exactly what the new validators can be pointed at.

Verification

Locally (Python / CLI-sh / Java / .NET): positive URL + local path for 4.2.9 and 4.1.0, negative fixture rejected (rc=1). PowerShell stacks (pwsh unavailable locally) are covered by the CI Windows matrix.

🤖 Generated with Claude Code

karlkauc and others added 2 commits May 18, 2026 10:08
…lution

The six XSD validators (CLI sh/ps1, Python, Java, .NET, PowerShell) now take
an explicit schema + XML file instead of a FundsXML <version>. The schema
argument is a local FundsXML.xsd path OR a remote URL (e.g. the official
release). No version arg, no FUNDSXML_SCHEMA_DIR, no .schema-cache, no
resolver module — whatever you point at is used as-is. Argument order is
schema-first, matching the Schematron/XSLT/XQuery invocations.

- Delete tools/fundsxml_schema.py and XSD_Validation/dotnet/SchemaResolver.cs;
  pyproject.toml is now a dependency-only manifest (py-modules = []).
- URL schemas: Python / CLI sh / CLI ps1-with-xmllint / Java fetch the schema
  (and the relative xmldsig-core-schema.xsd sibling that 4.2.9+ imports) into
  a temp dir then validate locally with instance XXE-hardening intact; .NET
  and PowerShell Validate-FundsXml.ps1 resolve a URL natively via
  XmlUrlResolver. The GitHub release 302-redirects to an opaque blob URL, so
  the relative import cannot be resolved post-redirect — hence the temp fetch.
- CI: drop the fundsxml_schema precache; plain-curl the official schemas into
  ci-schemas/ for the raw-xmllint steps; rewrite validator invocations to
  pass a schema; exercise the remote-URL path on every stack (Linux) and via
  the release URL on Windows.
- Docs (CLAUDE.md, root + XSD_Validation + per-area READMEs, CONTRIBUTING,
  .github templates) rewritten for the new <schema> <xml-file> contract.

Generators that embed the 4.2.9 release URL into xsi:noNamespaceSchemaLocation
(Large_File_Processing, Data_Binding_JSON, Database_Integration export) are
left as-is by design: that URL is a label on generated output, not schema
resolution, and is exactly what the new validators can be pointed at.

Verified locally (Python/CLI-sh/Java/.NET): positive URL + local path for
4.2.9 and 4.1.0, negative fixture rejected. PowerShell stacks covered by the
CI Windows matrix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-schema-arg

# Conflicts:
#	XSD_Validation/powershell/Validate-FundsXml.ps1
@karlkauc karlkauc merged commit d0676d7 into main May 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant