refactor(xsd): validators take <schema> <xml-file>, drop version-based resolution#21
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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>).tools/fundsxml_schema.pyandXSD_Validation/dotnet/SchemaResolver.cs.pyproject.tomlis now dependency-only (py-modules = []);.schema-cache/removed from.gitignore.xmldsig-core-schema.xsdsibling 4.2.9+ imports) into a temp dir, then validate locally — instance XXE-hardening (--nonet, no DTD/entities) unchanged. .NET and PowerShellValidate-FundsXml.ps1resolve a URL natively viaXmlUrlResolver. (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.)fundsxml_schemaprecache; plain-curlthe official schemas intoci-schemas/for the raw-xmllintsteps; validator steps now pass a schema and additionally exercise the remote-URL path on every stack (Linux) / via the release URL (Windows).CLAUDE.md, root +XSD_Validation+ per-area/per-version READMEs,CONTRIBUTING.md,.githubtemplates rewritten for the new contract.Generators — reviewed, intentionally unchanged
Large_File_Processing,Data_Binding_JSON,Database_Integrationexport embed the 4.2.9 release URL only as thexsi:noNamespaceSchemaLocationlabel 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 (
pwshunavailable locally) are covered by the CI Windows matrix.🤖 Generated with Claude Code