Enum Class ParseConfiguration.ElementBalancing

java.lang.Object
java.lang.Enum<ParseConfiguration.ElementBalancing>
org.attoparser.config.ParseConfiguration.ElementBalancing
All Implemented Interfaces:
Serializable, Comparable<ParseConfiguration.ElementBalancing>, Constable
Enclosing class:
ParseConfiguration

public static enum ParseConfiguration.ElementBalancing extends Enum<ParseConfiguration.ElementBalancing>

Enumeration representing the possible actions to be taken with regard to element balancing:

  • NO_BALANCING: Do not perform element balancing checks at all. Events will be reported as they appear. There is no guarantee that a DOM tree can be built from the fired events though.
  • REQUIRE_BALANCED: Require that elements are already correctly balanced in markup, throwing an exception if not. Note that when in HTML mode, this does not require the specification of optional tags such as <tbody>. Also note that this will automatically consider the ParseConfiguration.setNoUnmatchedCloseElementsRequired(boolean) flag to be set to true.
  • AUTO_OPEN_CLOSE: Auto open and close elements, which includes both those elements that, according to the HTML spec (when in HTML mode) have optional start or end tags (see http://www.w3.org/html/wg/drafts/html/master/syntax.html#optional-tags) and those that simply are unclosed at the moment a parent element needs to be closed (so their closing is forced). As an example of optional tags, the HTML5 spec establishes that <html>, <body> and <tbody> are optional, and that an <li> will close any currently open <li> elements. This is not really ill-formed code, but something allowed by the spec. All of these will be reported as auto-* events by the parser.
  • AUTO_CLOSE: Equivalent to AUTO_OPEN_CLOSE but not performing any auto-open operations, so that processing of HTML fragments is possible (no <html> or <body> elements are automatically added).

This enumeration is used at the ParseConfiguration class.