put with relative uri
Thursday, 5 October 2017 · 2 messages · last reply 6 Oct 2017
AB
Andy Bunce5 Oct 2017 15:10 #
Hi,
I notice
fn:put() appears to be resolving uris relative to the working directory, as the file module does, rather than static-base-uri() as fn:doc() does.
I dont think it was always like this and it seems to against the intent of the spec[1]?
/Andy
[1] The external effects of upd:put are implementation-defined, since they occur outside the domain of XQuery. The intent is that, if upd:put is invoked on a document node and no error is raised, a subsequent query can access the stored document by invoking fn:doc with the same URI. https://www.w3.org/TR/xquery-update-10/#id-upd-put
fn:put(<a/>"test.xml")
---------------------------
fn:doc("test.xml") (: [FODC0002] Resource 'C:/.../test.xml' does not exist. :)CG
Christian Grün6 Oct 2017 10:16 #
Hi Andy,
This has been fixed (I am not sure if it ever worked as it should ;-). In addition, I have added an optional third argument for serialization parameters [1].
A new snapshot will be available later this day.
Thanks,
Christian
[1] https://www.w3.org/TR/xquery-update-30/#id-func-put
Quoted text · Andy Bunce · 22 lines
On Thu, Oct 5, 2017 at 3:10 PM, Andy Bunce <bunce.andy at gmail.com> wrote: > Hi, > > I notice fn:put() appears to be resolving uris relative to the working > directory, as the file module does, rather than static-base-uri() as > fn:doc() does. > I dont think it was always like this and it seems to against the intent of > the spec[1]? > > /Andy > > > [1] The external effects of upd:put are implementation-defined, since they > occur outside the domain of XQuery. The intent is that, if upd:put is > invoked on a document node and no error is raised, a subsequent query can > access the stored document by invoking fn:doc with the same URI. > https://www.w3.org/TR/xquery-update-10/#id-upd-put > > fn:put(<a/>"test.xml") > --------------------------- > fn:doc("test.xml") (: [FODC0002] Resource 'C:/.../test.xml' does not exist. > :)
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery