Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
4.7.0
-
None
-
all
Description
The argument to the doc() function, which is an xs:anyUri, is percent-encoded when handled by Qt.
However, since the xs:anyUri should already be in final form (the unencoded uri is typically not a valid xs:anyUri), this causes the uri to be double-encoded
A typical XCAP uri is for example:
http://domain/document/~~/element[@id="first"]
which, percent-encoded, becomes
http://domain/document/~~/element%5B@name=%22first%22%5D
When trying to use this document however:
fn:doc( "http://domain/document/~~/element%5B@name=%22first%22%5D" )
the url is encoded again, resulting in .. %255Bfirst%2522%255D (i.e. the "%" themselves are encoded as "%25")
I have checked the same XQuery with Saxon, there it does not re-encode the uri's and the query works as expected.
IMHO the there are no special cases, any xs:anyUri used from the XQuery (for example in the doc and doc-exists functions) should simply be treated as final, when given to a QUrl, or percent-decoded first to their actual form so that QUrl re-encodes it (i.e. effectively encoded once).
Attachments
Issue Links
- is replaced by
-
QTBUG-8359 QXmlQuery: percent sign gets encoded
-
- Closed
-