Changes

Jump to navigation Jump to search
1,424 bytes added ,  15:32, 24 September 2013
no edit summary
{ 'separator' : ';', ... }
</pre>
|-
| '''Errors'''
|{{Error|BXCS0001|#Errors}} the input cannot be converted.<br/>{{Error|BXCS0003|#Errors}} the specified separator must be a single character.
|}
==csv:serialize==
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|csv:serialize|$input as node(), $options as item()|xs:string}}
|-
| '''Summary'''
|Serializes the node specified by {{Code|$input}} as CSV data, and returns the result as {{Code|xs:string}}.<br />XML documents can also be serialized as CSV if the [[Serialization|Serialization Option]] {{Code|"method"}} is set to {{Code|"csv"}}.<br/>The {{Code|$options}} argument can be used to control the way the node is serialized. The following options are available:
* {{Code|separator}} defines the character which separates columns in a row. By default, this is a comma ({{Code|,}}).
* {{Code|headers}} specifies if the input element names are to be interpreted as header names. The default value is {{Code|false}}.
Options can either be specified<br />
* as children of an {{Code|<csv:options/>}} element; e.g.:
<pre class="brush:xml">
<csv:options>
<csv:separator value=';'/>
...
</csv:options>
</pre>
* or as map, which contains all key/value pairs:
<pre class="brush:xquery">
{ 'separator' : ';', ... }
</pre>
|-
| '''Errors'''
|{{Error|BXCS0001BXCS0002|#Errors}} the input cannot be serialized.<br/>{{Error|BXCS0003|#Errors}} the specified separator must be a single character.
|}
! width="110"|Code
|Description
|-
|{{Code|BXCS0001}}
| The input cannot be converted.
|-
|{{Code|BXCS0002}}
| The node cannot be serialized.
|-
|{{Code|BXCS0001}}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu