base-uri of parsed documents should be the retrieval URL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
Nicolae Brinza |
Bug Description
Given a file /tmp/foo.xml and a query /tmp/foo.xq containing
fn:base-
the output is "file:/
The XQuery spec refers to the XML Base spec when describing the value of the base-uri property on node. XML Base defines how things behave when there is an xml:base attribute somewhere, and defers to RFC 3986 (URIs) for other cases. RFC 3986 says the base URI of content should be the first of the following things that exists:
(a) The base URI is embedded in the document's content (eg., xml:base attribute).
(b) The base URI is that of the encapsulating entity (message, document, etc).
(c) The base URI is the URI used to retrieve the entity.
(d) The base URI is defined by the context of the application.
This bug is referring to (c); we should set the base-uri of new nodes from external documents to be the URI used to load the document. So the query above should return "file:/
Related branches
- Sorin Marian Nasoi: Approve
- Chris Hillery: Approve
-
Diff: 102 lines (+22/-16)8 files modifiedsrc/runtime/sequences/sequences_impl.cpp (+2/-2)
test/fots/CMakeLists.txt (+3/-13)
test/fots_driver/fots-driver.xq (+1/-1)
test/rbkt/ExpQueryResults/zorba/uris/doc-base-uri.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/uris/file-base-uri.xml.res (+1/-0)
test/rbkt/Queries/zorba/uris/doc-base-uri.xq (+4/-0)
test/rbkt/Queries/zorba/uris/file-base-uri.xq (+9/-0)
test/rbkt/Queries/zorba/uris/input.xml (+1/-0)
tags: | added: store |
tags: |
added: xml-parser removed: store |
Changed in zorba: | |
milestone: | 2.9 → 3.0 |
Changed in zorba: | |
milestone: | 3.0 → 2.9 |
status: | Confirmed → Fix Released |
This may be part of the cause of bug 1105092, which is causing FOTS failures, hence I'm making it fairly high priority.