Parses HTML supplied as a string.

parse-html($html as xs:string) ➔ document-node()





The HTML content as a string




Notes on the Saxon implementation

Available since Saxon 9.2.


This function takes a single argument, a string containing the source text of an HTML document. It returns the document node (root node) that results from parsing this text using the TagSoup parser.

On the Java platform, the TagSoup jar file must be on the classpath. It may be downloaded from

On the .NET platform, the code of TagSoup 1.2 is available automatically: it has been compiled into the saxon9pe.dll and saxon9ee.dll assemblies.

This function is useful where an HTML document is embedded inside another using CDATA. It can also be used in conjunction with the unparsed-text() function to read HTML from filestore. Note that the base URI of the document is not retained in this case.