Repository navigation
[bugfix] cover native collection.xconf.xsd via OASIS catalog + jaxp - #6687
Merged
line-o merged 3 commits intoSep 14, 2026
Merged
Conversation
Contributor
📊 XQTS result comparisonComparison of this run against
Relative to 🔴 Newly failing tests (1)
🟢 Newly passing tests (1)
Runtime: 466.4s (+1.25s vs |
duncdrum
force-pushed
the
test/native-schema-jaxp-catalog-gap
branch
from
September 8, 2026 16:06
c19ea64 to
34dae71
Compare
Adds a control that jaxv-report + XSD 1.1 applies schema/collection.xconf.xsd, and an assertion that jaxp-report via an OASIS catalog mapping the collection-config namespace to that same file: URI reports valid — the tool-facing path eXist-db#6528 advertised but never integration-tested (eXist-db#6686). Co-authored-by: Cursor <cursoragent@cursor.com>
validation:jaxp-report()'s XSD 1.1 retry validator wired an OASIS/system catalog's org.xmlresolver.Resolver in directly as the LSResourceResolver. That resolver's resolveResource() requires a non-null systemId before it will consult the catalog at all, so a <uri> entry keyed purely by namespace was invisible whenever the instance had no schemaLocation hint -- even though the same catalog entry already worked for the default SAX pipeline, which falls back to the namespace as the systemId. Add XercesXmlResolverAdapter#asLSResourceResolver to apply that same namespace-as-systemId fallback to the XSD 1.1 validator pipeline, and wire it into Jaxp#newXsd11Validator. Turns NativeSchemaJaxpCatalogGapTest's jaxpViaOasisCatalogAgainstNativeCollectionSchemaValid green. Closes eXist-db#6686
duncdrum
force-pushed
the
test/native-schema-jaxp-catalog-gap
branch
from
September 9, 2026 14:41
34dae71 to
d3dc43d
Compare
Code review of the jaxp fix (previous commit) found the identical gap unfixed on validation:jaxv()'s SchemaFactory catalog wiring: it passed the raw org.xmlresolver.Resolver straight to setResourceResolver(), so an xs:import/xs:include with no schemaLocation, resolved purely by namespace through an OASIS/system catalog, would silently fail the same way jaxp's XSD 1.1 validator did. Add an asLSResourceResolver(LSResourceResolver) overload that centralizes the Resolver-vs-other dispatch (mirroring the existing switch in setXmlReaderEntityResolver), and use it from both Jaxp and Jaxv instead of duplicating the instanceof check. Also escape the file: URI embedded in NativeSchemaJaxpCatalogGapTest's generated catalog.xml, since Path#toUri() does not XML-escape characters like '&' that a checkout directory name could legally contain.
dizzzz
reviewed
Sep 9, 2026
dizzzz
approved these changes
Sep 9, 2026
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.
Description:
Adds
NativeSchemaJaxpCatalogGapTestto close the integration gap left by #6528, and fixes the gap it found:validation:jaxv-report+ XSD 1.1 language URI againstschema/collection.xconf.xsd(valid minimalcollection.xconf; empty one failsxs:assert).validation:jaxp-reportvia an OASIS catalog whose<uri>mapshttp://exist-db.org/collection-config/1.0to an absolutefile:URI of that same native XSD — mirrors theWEB-INF/catalog.xml→$EXIST_HOME/schema/wiring tools are meant to use.Root cause:
Jaxp#newXsd11Validatorwired an OASIS/system catalog'sorg.xmlresolver.Resolverin directly as the XSD 1.1 validator'sLSResourceResolver. That resolver'sresolveResource()requires a non-nullsystemIdbefore it will consult the catalog at all, so a<uri>entry keyed purely by namespace was invisible whenever the instance carried noschemaLocationhint — even though the same catalog entry already worked for the default SAX pipeline, which falls back to the namespace as the systemId (seeXercesXmlResolverAdapter#resolveEntity).Fix:
XercesXmlResolverAdapter#asLSResourceResolverapplies that same namespace-as-systemId fallback. Code review of the first fix foundvalidation:jaxv()'s SchemaFactory catalog wiring had the identical unfixed gap (same raw-Resolverpass-through, forxs:import/xs:includeresolution during schema compilation), so it's fixed the same way and both call sites now share a singleasLSResourceResolver(LSResourceResolver)dispatch instead of duplicating theinstanceofcheck.Existing coverage did not catch this:
JaxpXsdCatalogTestXSD 1.1 cases use directory-search over/db/.../, whichSearchResourceResolveralready resolves purely by namespace;CollectionConfigSchema6000Test/ Maven validate use rawSchemaFactory, notvalidation:jaxp.What Changed
exist-core/src/main/java/org/exist/resolver/XercesXmlResolverAdapter.java— newasLSResourceResolver(Resolver)wrapping anorg.xmlresolver.Resolveras anLSResourceResolverwith a namespace→systemId fallback, plus anasLSResourceResolver(LSResourceResolver)overload that dispatches on the concrete resolver type (only wrapping when it's aResolver) so both call sites below share one implementation.exist-core/src/main/java/org/exist/xquery/functions/validation/Jaxp.java—newXsd11Validatornow routes its catalog resolver through the new adapter before handing it to the XSD 1.1Validator.exist-core/src/main/java/org/exist/xquery/functions/validation/Jaxv.java— same fix for theSchemaFactory#setResourceResolvercatalog wiring.exist-core/src/test/java/org/exist/xquery/functions/validate/NativeSchemaJaxpCatalogGapTest.java— the regression test; updated comments now that the gap is closed, and escapes the generated catalog'sfile:URI attribute (Path#toUri()doesn't XML-escape characters like&a checkout path could contain).Reference:
Type of tests:
JUnit (
ExistXmldbEmbeddedServer) inexist-core.Test Plan
NativeSchemaJaxpCatalogGapTest— 3/3 green (was 2/3, 1 expected-red)JaxpXsdCatalogTest— 12/12 green (no regression)validate/validationpackage (JaxpParseTest,JaxvTest,JaxpDtdCatalogTest,JaxpSchemaLocationSecurityTest,JaxpXsd11DetectionCacheTest,IsMissingElementDeclarationTest, Jing*/Parse* suites, etc.) — 77/77 greenunparsed-text-from-url, unrelated fn:unparsed-text() GitHub-raw fetch)Made with Cursor