Changes

Jump to navigation Jump to search
40 bytes removed ,  18:51, 18 November 2020
This [[Module Library|XQuery Module]] contains a single function to parse CSV input. [httphttps://en.wikipedia.org/wiki/Comma-separated_values CSV] (comma-separated values) is a popular representation for tabular data, exported e. g. from Excel.
=Conventions=
If the {{Code|direct}} or {{Code|attributes}} format is chosen, a CSV string is converted to XML:
* The resulting XML document has a {{Code|<csv>}} root element.* Rows are represented via {{Code|<record>}} elements.* Fields are represented via {{Code|<entry>}} elements. The value of a field is represented as text node.
* If the {{Code|header}} option is set to {{Code|true}}, the first text line is parsed as table header:
** If {{Code|format}} is set to {{Code|direct}}, the field names are encoded , as described in the [[Conversion Module#Keys|Conversion Module]] , and used as element names.
** Otherwise, if {{Code|format}} is {{Code|attributes}}, the field names will be stored in name attributes.
==csv:doc==
 
{{Mark|Introduced with BaseX 9.4:}}
{| width='100%'
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu