Changes

Jump to navigation Jump to search
45 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 header 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.
'''A little advice''': in the Database Creation dialog of the GUI, if you select CSV Parsing and switch to the ''Parsing'' tab, you can see the effects of some of the conversion options.
==csv:doc==
 
{{Mark|Introduced with BaseX 9.4:}}
{| width='100%'
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu