Commit e66da0b
[feature] Decode-then-encode collection() and xmldb: read paths too (decision 2, all surfaces)
Extends the doc() decode-then-encode canonicalization to the remaining read
surfaces so a literal '%' (and any decoded/descriptor-derived name) resolves
consistently everywhere, not just in fn:doc (#6463, decisions 1+2+5):
- fn:collection (ExtCollection.eval): canonicalize a bare db-path before asUri,
so collection("/db/x/50%done") reaches the 50%25done key. asUri's new URI(path)
rejected a literal '%' (malformed escape) before; a scheme-ful URI (xmldb:,
file:, ...) is left untouched so its scheme/authority are not rewritten.
- xmldb: collection reads (XMLDBAbstractCollectionManipulator.getLocalCollection):
upgrade the earlier escape=true normalization to decode-then-encode, so
xmldb:collection-available / get-child-resources / get-child-collections resolve
a literal-% collection by its decoded name, matching fn:doc / fn:collection.
decodeForURI is the exact inverse of encodeForURILenient, so each is idempotent on
an already-encoded path. XmldbCollectionAddressByDecodedNameTest gains
literalPercentCollectionResolvesByDecodedName (xmldb:collection-available and
fn:collection over a literal-% collection). XPathQueryTest (150) stays green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2fba91b commit e66da0b
3 files changed
Lines changed: 51 additions & 10 deletions
File tree
- exist-core/src
- main/java/org/exist/xquery/functions
- fn
- xmldb
- test/java/org/exist/xquery/functions/xmldb
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
| |||
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
94 | 125 | | |
95 | 126 | | |
96 | 127 | | |
| |||
0 commit comments