> The XQuery Processor
"http://www.zorba-xquery.com/zorba/util-functions" has to be included at the beginning of a query. For example
import module namespace zorba-util = "http://www.zorba-xquery.com/zorba/util-functions";
declare function tidy($str as xs:string) as xs:string
Summary: Assuming $str contains a "dirty" HTML the function will return a valid XHTML version of the $str.
Error conditions:
If Tidy lib is not able to transform the given string into a valid XHTML, an error is raised XQP0029_TIDY_ERROR (see Appendix A: Error codes).
declare function tdoc($uri as xs:string?) as document-node()?
Summary: This function if very similar to the 15.5.4 fn:doc from XQuery 1.0 and XPath 2.0 Functions and Operators function. The only difference is that prior to parsing and inserting the document identified by $uri in the store, tdoc function transforms the document into a valid XHTML document with the help of Tidy lib.
Error conditions:
If Tidy lib is not able to transform the given string into a valid XHTML, an error is raised XQP0029_TIDY_ERROR (see Appendix A: Error codes).