Changes

Jump to navigation Jump to search
378 bytes added ,  16:40, 18 July 2023
no edit summary
===GUI===
Go to Menu ''Database'' → ''New'' and select "HTML" in the input format combo box.There's an info in the "Parsing" tab about whether TagSoup is available or not. Thesame applies to the "Resources" tab in the "Database Properties" dialog.
These two dialogs come with an input field 'Parameters' where TagSoup optionscan be entered.
===Command Line===
===XQuery===
The [[HTML Module]] provides XQuery functions for converting HTML to XML documents. In addition, all functions that accept [[Options#Parsing|Parsing Options]] can be used as well to convert HTML:
<syntaxhighlight lang="xquery">
==XQuery==
The [[JSON Module]] provides functions for converting JSON objects to XML documentsIn addition, all functions that accept [[Options#Parsing|Parsing Options]] can be used as well to convert JSON. The following query converts a JSON string to an XML document, using the conversion format {{Code|[[JSON Module#Basic|basic]]}}: <syntaxhighlight lang="xquery">db:create('json-db', '{ "key": "value" }', 'example.json', map { 'parser': 'json', 'jsonparser': map { 'format': 'basic' }})</syntaxhighlight>
=CSV Parser=
==XQuery==
The [[CSV Module]] provides a function for converting CSV to XML documents.
Documents In addition, all functions that accept [[Options#Parsing|Parsing Options]] can also be converted by specifying used as well to convert CSV. In the parser in an XQuery function.The following example query adds , all CSV files that from a directory are located in thedirectory {{Code|2Bimported}} added to the a database {{Code|DB}} and interprets, with the first lines line of each file interpreted as column headersheader:
<syntaxhighlight lang="xquery">
for $file in file:list("2Bimported", false(), "*.csv")
return db:add("DBcsv-db", $file, "", map {
'parser': 'csv',
'csvparser': map { 'header': true() }
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu