Cover Saxon's unparsed-text family and json-doc on the TrAX path - #71
Merged
garydgregory merged 2 commits intoSep 1, 2026
Merged
Conversation
The XPath 3.1 unparsed-text functions and json-doc do not go through the JAXP URIResolver that governs document() and xsl:include; Saxon routes them through the Configuration's resource resolver. Only the XPath path had tests for that chain, leaving the stylesheet side of it unverified even though the factory wrapper's floor already covers it. Add the TrAX companion of SaxonXPathExternalCallsTest: the three content functions are checked as leak pairs (unconfigured Saxon copies the marker into the output, the secured factory does not), and unparsed-text-available as an existence oracle the secured factory must not answer from the real filesystem. No production change: the secured factory already blocks every one of these. Assisted-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CLnTBsvmYtxzNTWVGNyz33
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.
Saxon's XPath 3.1
unparsed-text,unparsed-text-lines,unparsed-text-availableandjson-docdo not go through the JAXPURIResolverthat governsdocument()andxsl:include/xsl:import: Saxon routes them through theConfiguration's resource resolver.SaxonXPathExternalCallsTestcovers that chain on the XPath path, where the floor sits on theConfigurationdirectly, but the stylesheet side had no equivalent — the TrAX path installs its floor through the factory wrapper'ssetURIResolver, and nothing verified that the two routes meet.They do. This adds the TrAX companion test, and no production change is needed:
unparsed-text,unparsed-text-lines,json-doc— checked as leak pairs. An unconfigured Saxon factory resolves the URI and copies the marker into the transform output (control, proving the vector is real); the secured factory does not. Saxon reportsFOUT1170 Resolver for unparsed-text() returned non-StreamSource, i.e. the floor is consulted for the text-nature request and answers withEmptySource.unparsed-text-available— discloses no content, so it is checked as an existence oracle: the unconfigured factory distinguishes an existing fixture from a missing sibling, and the secured factory must not.Saxon is instantiated reflectively behind an
assumeSaxonPresent()guard, followingSaxonAlternateFactoryTest, so the class is effective on thetest-saxonandtest-saxon-xercesexecutions (7 run, 0 failures) and skips on the four executions without Saxon. Full matrix green.🤖 Generated with Claude Code