Class TagSoupParser

  • public class TagSoupParser
    extends Object

    Parses an InputStream into an HTML DOM tree.

    Note: The resulting DOM tree will not be namespace aware, and all element names will be upper case, while attributes will be lower case. This is because the HTML parser uses the Xerces HTML DOM implementation, which doesn't support namespaces and forces uppercase element names. This works with the RDFa XSLT Converter and with XPath, so we left it this way.

    Richard Cyganiak (richard at cyganiak dot de), Michele Mostarda (, Davide Palmisano (
    • Method Detail

      • getDOM

        public Document getDOM()
                        throws IOException
        Returns the DOM of the given document IRI.
        the HTML DOM.
        IOException - if there is an error whilst accessing the DOM
      • getValidatedDOM

        public DocumentReport getValidatedDOM​(boolean applyFix)
                                       throws IOException,
        Returns the validated DOM and applies fixes on it if applyFix is set to true.
        applyFix - whether to apply fixes to the DOM
        a report containing the HTML DOM that has been validated and fixed if applyFix if true. The reports contains also information about the activated rules and the the detected issues.
        IOException - if there is an error accessing the DOM
        ValidatorException - if there is an error validating the DOM