From 210e0f067f2091ead7d6aa881053de7769ee9339 Mon Sep 17 00:00:00 2001
From: Michael Kay The default row delimiter is a single newline character The default row delimiter is a single newline character All fields are returned as Quoted fields in the input are returned without the quotes. For more discussion of the returned data, see The An empty field is represented by a zero-length string. An empty field is deemed to exist
@@ -26322,8 +26324,8 @@ return (
contain no rows; while if xs:string
whose length is exactly one.
- Defaults to a single newline character (unparsed-text
function, alternative line endings
- such as CR
and CRLF
will have been normalized to a single
- newline. In other cases, this normalization can be achieved by setting the
- normalize-newlines
option.CR
and CRLF
will already have been normalized to a single
+ newline.xs:string
values.$value
argument is CSV data, as defined in xs:string
value. The function parses this string.
+ xs:string
value. The function parses this string,
+ after normalizing newlines so that array(xs:string)*
; each array represents one row of the CSV input.$value
consists of a single row delimiter,
it is considered to contain a single blank row. The presence or
absence of a final row delimiter generally has no effect on the result,
- except in the situation described in the previous paragraph where it causes a
- blank row to exist.
quote-character
.
The default row delimiter is a single newline character unparsed-text
function, alternative line endings
- such as CR
and CRLF
will have been normalized to a single
- newline. In other cases, this normalization can be achieved by setting the
- option normalize-newlines
. This option does not affect CR or CRLF
- sequences occurring within quoted fields.
The default row delimiter is a single newline character CR
and CRLF
will already have been normalized to a single
+ newline.
All fields are returned as xs:string
values.
Quoted fields in the input are returned without the quotes.
The first row is not treated specially.
@@ -26405,8 +26405,7 @@ return ( return csv-to-arrays( `name,city{ $CRLF }` || `Bob,Berlin{ $CRLF }` || - `Alice,Aachen{ $CRLF }`, - { "normalize-newlines": true() } + `Alice,Aachen{ $CRLF }` )With defaults for delimiters and quotes, recognizing headers:
This specification uses the term
Row delimiters other than CRLF
are recognized.
Line endings are normalized: specifically, the character sequences
+
Row delimiters other than newline are recognized.
Field delimiters other than comma (","
) are recognized.
Quote characters other than the double quotation mark ('"'
)
are recognized.
Rows in CSV files are typically delimited with CRLF (fn:unparsed-text
- function normalizes these line endings to LF (fn:unparsed-text
function does it automatically.
+ although RFC 4180 specifies CRLF. The CSV parsing functions
+ normalize these line endings to LF (
The last row in the file may or may not be followed by a row delimiter.
+The last row in the file may or may not be followed by a row delimiter. + An empty file is treated as containing zero rows, while a file consisting solely + of a row delimiter is treated as containing one empty row. In all other cases, + a file that does not end with a row delimiter is treated as if a row delimiter were + added at the end.
Fields in CSV are frequently delimited with a comma. Other field delimiters are useful, for @@ -6982,7 +6987,7 @@ correctly in all browsers, depending on the system configuration.
--> chosen field delimiter is then oftenThe column delimiter defaults to
The column delimiter thus defaults to column-delimiter
option is set to a multi-character string.
CSVs, as specified in
CSVs, as specified in