Class XHtmlParser

java.lang.Object
org.loboevolution.html.parser.XHtmlParser

public class XHtmlParser extends Object
The XHtmlParser class is an HTML DOM parser. This parser provides the functionality for the standard DOM parser implementation DocumentBuilderImpl. This parser class may be used directly when a different DOM implementation is preferred.
  • Field Details

  • Constructor Details

    • XHtmlParser

      public XHtmlParser(UserAgentContext ucontext, Document document)
      Constructs a XHtmlParser.
      Parameters:
      ucontext - The user agent context.
      document - A W3C Document instance.
    • XHtmlParser

      public XHtmlParser(UserAgentContext ucontext, Document document, boolean needRoot)
      Constructs a XHtmlParser.
      Parameters:
      ucontext - The user agent context.
      document - An W3C Document instance.
      needRoot - a boolean.
  • Method Details

    • isDecodeEntities

      public static boolean isDecodeEntities(String elementName)

      isDecodeEntities.

      Parameters:
      elementName - a String object.
      Returns:
      a boolean.
    • parse

      public void parse(LineNumberReader reader, Node parent) throws IOException, SAXException
      This method may be used when the DOM should be built under a given node, such as when innerHTML is used in Javascript.
      Parameters:
      reader - A LineNumberReader for the document.
      parent - The root node for the parsed DOM.
      Throws:
      IOException - if any.
      SAXException - if any.
    • parse

      public void parse(Reader reader) throws IOException, SAXException
      Parses HTML given by a Reader. This method appends nodes to the document provided to the parser.
      Parameters:
      reader - An instance of Reader.
      Throws:
      IOException - if any.
      SAXException - if any.
    • parse

      public void parse(Reader reader, Node parent) throws IOException, SAXException
      This method may be used when the DOM should be built under a given node, such as when innerHTML is used in Javascript.
      Parameters:
      reader - A document reader.
      parent - The root node for the parsed DOM.
      Throws:
      IOException - if any.
      SAXException - if any.
    • parse

      public void parse(LineNumberReader reader) throws IOException, SAXException

      parse.

      Parameters:
      reader - a LineNumberReader object.
      Throws:
      IOException - if any.
      SAXException - if any.