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?
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
$node as node(),
$uri as xs:string,
$params as element(output:serialization-parameters)?
An implementation that uses serialization when storing the node may use the serialization parameters identified by $params.
- 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