Changes

Jump to navigation Jump to search
1,149 bytes added ,  23:15, 17 October 2013
no edit summary
|}
BaseX provides some additional, implementation-specific serialization parameters (the {{Code|csv}} and {{Code|json}} parameters may be subject to change):
{| class="wikitable sortable" width="100%"
! Default
|- valign="top"
| {{Code|csv-header}}| Indicates if Defines the input contains a header rowway how data is serialized as CSV. {{Version|7.7.28}}| {{Code|yes}}, {{Code|no}}| {{Code|no}}|- valign="top"| {{Codesee [[CSV Module#csv:serialize|csv-separator}}| Defines the character which separates fields in a row. {{Version|7.7.2}}| ''single character''| {{Code|,}}|- valign="top"| {{Code|json-spec}}| Determines the used JSON specification. {{Version|7.7.2}}| {{Code|RFC4627}}, {{Code|ECMA-262}}, {{Code|liberal}}| {{Code|RFC4627}}|- valign="top"| {{Code|json-unescape}}| Determines whether escape sequences (marked by a backslash) in the input are expanded. {{Version|7.7.2}}:serialize]]| {{Code|yes}}, {{Code|no}}| {{Code|yes}}
|- valign="top"
| {{Code|json-format}}
| Determines the conversion format. {{Version|7.7.2}}
| {{Code|json}}, {{Code|jsonml}}
| {{Code|json}}
| Defines the way how data is serialized as JSON. {{Version|7.8}}
| see [[JSON Module#json:serialize|json:serialize]]
|
|- valign="top"
| {{Code|format}}
| {{Code|\n}}, {{Code|\r\n}}, {{Code|\r}}
| ''system dependent''
|}
 
The values of the {{Code|csv}} and {{Code|json}} parameters may be a list of CSV/JSON option names and values, combined with {{Code|=}} and separated by {{Code|,}}:
 
<pre class="brush:xquery">
declare option output:method "csv";
declare option output:csv "header=yes, separator=semicolon";
<csv>
<record>
<Text>...bla...</Text>
</record>
</csv>
</pre>
 
{| class="wikitable sortable" width="100%"
|- valign="top"
! width="140" | Parameter
! width="60%" | Description
! Allowed
! Default
|- valign="top"
| {{Code|separator}}
| Defines the character which separates the entries of a record in a single line.
| {{Code|comma}}, {{Code|semicolon}}, {{Code|colon}}, {{Code|tab}}, {{Code|space}} or a ''single character''
| {{Code|comma}}
|- valign="top"
| {{Code|format}}
| Specifies the CSV format of the XML data.
| {{Code|direct}}, {{Code|attributes}}
| {{Code|direct}}
|- valign="top"
| {{Code|header}}
| Indicates if the original CSV data contained a header row.
| {{Code|yes}}, {{Code|no}}
| {{Code|no}}
|- valign="top"
| {{Code|lax}}
| Specifies if a lax approach is used to convert QNames to JSON names.
| {{Code|yes}}, {{Code|no}}
| {{Code|yes}}
|- valign="top"
| {{Code|json-spec}}
| Determines the used JSON specification. {{Version|7.7.2}}
| {{Code|RFC4627}}, {{Code|ECMA-262}}, {{Code|liberal}}
| {{Code|RFC4627}}
|- valign="top"
| {{Code|json-unescape}}
| Determines whether escape sequences (marked by a backslash) in the input are expanded. {{Version|7.7.2}}
| {{Code|yes}}, {{Code|no}}
| {{Code|yes}}
|- valign="top"
| {{Code|json-format}}
| Determines the conversion format. {{Version|7.7.2}}
| {{Code|json}}, {{Code|jsonml}}
| {{Code|json}}
|}
;Version 7.8
* Added: {{Code|csv}} and {{Code|json}} serialization parameters
* Removed: {{Code|separator}} option (use {{Code|item-separator}} instead)
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu