Fix relative xsl:import path resolution when stylesheet load#206
Open
Laurettta wants to merge 1 commit intodevelop-7.x.xfrom
Open
Fix relative xsl:import path resolution when stylesheet load#206Laurettta wants to merge 1 commit intodevelop-7.x.xfrom
Laurettta wants to merge 1 commit intodevelop-7.x.xfrom
Conversation
…ed from database Closes #169 When a stylesheet is loaded from the database as a document node, its base URI is stored as a bare path (e.g. /db/collection/a.xsl) with no scheme. The URI resolver did not recognise this as a database path and returned the relative href unchanged, causing xsl:import with a relative path to fail. The fix detects the bare path, extracts the directory, and reconstructs the full xmldb:exist:// URI so the import resolves correctly.
Not up to standards ⛔
|
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.
When a stylesheet is loaded from the database via
doc(), the base URI comes through as a plain path like/db/collection/a.xslwith noxmldb:exist://scheme. The URI resolver treated it as non-absolute and just returned the relativehrefunchanged, so<xsl:import href="b.xsl"/>failed even whenb.xslwas sitting in the same collection.The fix checks if the base path starts with
/and if so rebuilds it as a fullxmldb:exist://URI before resolving the import.