HTML Module

This XQuery Module provides functions for converting HTML to XML. Conversion will only take place if TagSoup is included in the classpath (see HTML Parsing for more details).

=Conventions=

All functions and errors in this module are assigned to the  namespace, which is statically bound to the html prefix.

=Functions=

html:parse
=Examples=

Basic Example
The following query converts the specified string to an XML document node.

 html:parse(" ")
 * Query:

 
 * Result:

Specifying Options
The next query creates an XML document with namespaces:

 html:parse("", map { 'nons': false })
 * Query:

  
 * Result:

Parsing Binary Input
If the input encoding is unknown, the data to be processed can be passed on in its binary representation. The HTML parser will automatically try to detect the correct encoding:

 html:parse(fetch:binary("https://en.wikipedia.org"))
 * Query:

  Wikipedia, the free encyclopedia  ...
 * Result:

=Errors=

=Changelog=


 * Version 9.0


 * Updated: error codes updated; errors now use the module namespace

The module was introduced with Version 7.6.