Bug 15979 - [Upd 3.0] fn:put() serialization parameters
[Upd 3.0] fn:put() serialization parameters
Status: RESOLVED FIXED
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update 3.0
Working drafts
PC Linux
: P2 normal
: ---
Assigned To: John Snelson
Mailing list for public feedback on specs from XSL and XML Query WGs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-14 09:57 UTC by Jonathan Robie
Modified: 2014-01-21 17:25 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Robie 2012-02-14 09:57:05 UTC
When using fn:put() to create files on a file system, serialization parameters are extremely helpful for those who must edit the files later with a text editor. So it would be good to support serialization parameters for fn:put().

But if fn:put() is used to add results to a persistent store, serialization options may nor may not be relevant, depending on the store. What should a store do if it can not comply with serialization options that have been specified? Raise an error? Ignore them silently?
Comment 1 Josh Spiegel 2013-01-30 15:39:50 UTC
ACTION A-529-04 Josh to comment in the bug 15979 with a proposal for adding serialization parameters to put

-------

* 2.8.1 fn:put 

fn:put($node as node(), $uri as xs:string) as empty-sequence()
fn:put($node as node(), $uri as xs:string, $params as element(output:serialization-parameters)?) as empty-sequence()

The two-argument version of this function has the same effect as the three-argument version called with $params set to an empty sequence. This in turn is the same as the effect of passing an output:serialization-parameters element with no child elements.

The $params argument is used to identify a set of serialization parameters. These are supplied in the form of an output:serialization-parameters element, having the format described in Section 3.1 Setting Serialization Parameters by Means of a Data Model Instance SER30.  The intent is that an implementation that serializes the $node argument during storage may use the serialization parameters.  In this case, the implementation should raise a dynamic error if setting the serialization parameters produces a serialization error or if an invalid parameter value is detected.  An implementation may ignore the $params argument but must not raise an error because parameters are specified.  

Semantics, bullet 4:  
   upd:put($node, $uri) -> upd:put($node, $uri, $params)


* 3.1.12 upd:put

upd:put(
   $node as node(),
   $uri as xs:string,
   $params as element(output:serialization-parameters)?
)

Semantics:
  An implementation that uses serialization when storing the node may use the serialization parameters identified by $params.

------- 

Notes:
 - There was a question about default parameters at the WG meeting.  fn:serialize doesn't prescribe defaults so we shouldn't here either.
 - Some of the above text is copied from FNO30