[Bug 13970] New: [UPD] fn:put and transform expressions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 13970] New: [UPD] fn:put and transform expressions

Bugzilla from bugzilla@jessica.w3.org
http://www.w3.org/Bugs/Public/show_bug.cgi?id=13970

           Summary: [UPD] fn:put and transform expressions
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Update Facility
        AssignedTo: [hidden email]
        ReportedBy: [hidden email]
         QAContact: [hidden email]


Are there any special considerations when mixing fn:put with transform
expressions?

Example 1
---------

copy $dummy := <dummy />
modify fn:put(<new-document />, "output.xml")
return local:non-updating-query()

This stores an element in output.xml but also returns the result of executing a
non-updating query.  

It seems a little unfortunate that this 'dummy' is required to mix fn:put with
a non-updating query - although since this is essentially an expression with
side effects, perhaps that's no bad thing.

Example 2
---------

let $original := doc('update.xml')
return
  copy $doc := $original
  modify (insert node <node /> into $doc/nodes, fn:put($doc, "update.xml"))
  return $original

This example reads and writes the same resource.  In XSLT, there is a specific
(recoverable) error which mentions a similar situation with
xsl:result-document.

[ERR XTRE1500] It is a recoverable dynamic error for a stylesheet to write to
an external resource and read from the same resource during a single
transformation, whether or not the same URI is used to access the resource in
both cases.

Example 3
---------

copy $doc := doc('update.xml')
modify (insert node <node /> into $doc/nodes, fn:put($doc, "update.xml"))
return (count($doc/nodes/node), count(doc('update.xml')/nodes/node))

Because 'doc' is stable the two calls to doc must return the same result, even
though an update has occurred.

Example 4
---------

copy $doc := <a />
modify (fn:put($doc, "update.xml"))
return doc('update.xml')

Does doc('update.xml') see the newly created resource, or the original resource
(if we assume one was available)?

--
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Reply | Threaded
Open this post in threaded view
|

[Bug 13970] [UPD] fn:put and transform expressions

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13970

Christian Gruen <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #1 from Christian Gruen <[hidden email]> ---
Has there been any more discussion on this issue?

I would even suggest to completely disallow fn:put() functions inside transform
expressions in order to reduce the chance of indeterministic,
implementation-dependent behavior. For example, in the following example..

  copy $a := <a/> modify fn:put($a, "1") return (),
  copy $b := <b/> modify fn:put($b, "2") return ()

we will have no guarantee if $a or $b will be found in the final result.

--
You are receiving this mail because:
You are the QA Contact for the bug.

Reply | Threaded
Open this post in threaded view
|

[Bug 13970] [UPD] fn:put and transform expressions

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13970

--- Comment #2 from Tim Mills <[hidden email]> ---
The WG hasn't discussed bugs against XQuery Update 1.0 for quite some time due
to a focus on XQuery 3.0.

--
You are receiving this mail because:
You are the QA Contact for the bug.

Reply | Threaded
Open this post in threaded view
|

[Bug 13970] [UPD] fn:put and transform expressions

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13970

Jonathan Robie <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Jonathan Robie <[hidden email]> ---
The Working Group has decided that it is an error if the modify clause of a
transform expression produces a upd:put primitive.

--
You are receiving this mail because:
You are the QA Contact for the bug.

Reply | Threaded
Open this post in threaded view
|

[Bug 13970] [UPD] fn:put and transform expressions

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13970

--- Comment #4 from Tim Mills <[hidden email]> ---
I'm reopening, as I'm unable to find the agreed change in the XQuery Update 3.0
editor's draft.

--
You are receiving this mail because:
You are the QA Contact for the bug.

Reply | Threaded
Open this post in threaded view
|

[Bug 13970] [UPD] fn:put and transform expressions

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13970

John Snelson <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED
                 CC|                            |[hidden email]

--- Comment #5 from John Snelson <[hidden email]> ---
I'm closing this bug again, as the decision is recorded in changes.txt and will
be made in the course of time.

--
You are receiving this mail because:
You are the QA Contact for the bug.