http://www.zorba-xquery.com/modules/tidy

Module Description

This module provides functions to tidy HTML. The functions in this module take an HTML document (a string) as parameter, tidy it in order to result in valid XHTML, and return this XHTML document as a document-node.

The functions use the Tidy Library Project for the tidy process.

Function Summary
tidy($html as xs:string) as document()
tidy($html as xs:string, $options as xs:string?) as document()
Functions
tidy
declare function tidy:tidy (
$html as xs:string
) as document() external

This function tidies the given HTML string and returns a valid XHTML document node.

Parameters:
$html - the HTML string to tidy
Returns:

the tidied XHTML document node


tidy
declare function tidy:tidy (
$html as xs:string,
$options as xs:string?
) as document() external

This function tidies the given HTML string and returns a valid XHTML document node.

The second parameter allows to specify options that configure the tidy process. This parameter is a sequence of name=value pairs. Allowed parameter names and values are documented at http://tidy.sourceforge.net/docs/quickref.html.

Parameters:
$html - the HTML string to tidy
$options - a sequence of name=value pairs that provide options to configure the tidy process.
Returns:

the tidied XHTML document node