Package org.w3c.tidy
Class ParserImpl
java.lang.Object
org.w3c.tidy.ParserImpl
HTML Parser implementation.
- Version:
- $Revision: 1100 $ ($Author: aditsu $)
- Author:
- Dave Raggett dsr@w3.org , Andy Quick ac.quick@sympatico.ca (translation to Java), Fabrizio Giustina
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classParser for block elements.static classParser for BODY.static classParser for COLGROUP.static classParser for DEFLIST.static classParser for empty elements.static classParser for FRAMESET.static classParser for HEAD.static classParser for HTML.static classParser for INLINE.static classParser for LIST.static classParser for NOFRAMES.static classParser for OPTGROUP.static classParser for PRE.static classParser for ROW.static classParser for ROWGROUP.static classParser for SCRIPT.static classParser for SELECT.static classParser for TABLE.static classParser for text nodes.static classParser for TITLE. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Parserparser for block elements.static final Parserparser for body.static final Parserparser for colgroup.static final Parserparser for definition lists.static final Parserparser for empty elements.static final Parserparser for frameset.static final Parserparser for head.static final Parserparser for html.static final Parserparser for inline.static final Parserparser for list.static final Parserparser for noframes.static final Parserparser for optgroup.static final Parserparser for pre.static final Parserparser for row.static final Parserparser for rowgroup.static final Parserparser for script.static final Parserparser for select.static final Parserparser for table.static final Parserparser for text.static final Parserparser for title. -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidmoveToHead(Lexer lexer, Node element, Node node) Move node to the head, where element is used as starting point in hunt for head.static NodeparseDocument(Lexer lexer) HTML is the top level element.protected static voidstatic NodeparseXMLDocument(Lexer lexer) static voidparseXMLElement(Lexer lexer, Node element, short mode) XML documents.static booleanXMLPreserveWhiteSpace(Node element, TagTable tt) Indicates whether or not whitespace should be preserved for this element.
-
Field Details
-
HTML
parser for html. -
HEAD
parser for head. -
TITLE
parser for title. -
SCRIPT
parser for script. -
BODY
parser for body. -
FRAMESET
parser for frameset. -
INLINE
parser for inline. -
LIST
parser for list. -
DEFLIST
parser for definition lists. -
PRE
parser for pre. -
BLOCK
parser for block elements. -
TABLETAG
parser for table. -
COLGROUP
parser for colgroup. -
ROWGROUP
parser for rowgroup. -
ROW
parser for row. -
NOFRAMES
parser for noframes. -
SELECT
parser for select. -
TEXT
parser for text. -
EMPTY
parser for empty elements. -
OPTGROUP
parser for optgroup.
-
-
Method Details
-
parseTag
- Parameters:
lexer-node-mode-
-
moveToHead
Move node to the head, where element is used as starting point in hunt for head. Normally called during parsing.- Parameters:
lexer-element-node-
-
parseDocument
HTML is the top level element. -
XMLPreserveWhiteSpace
Indicates whether or not whitespace should be preserved for this element. If anxml:spaceattribute is found, then if the attribute value ispreserve, returnstrue. For any other value, returnsfalse. If anxml:spaceattribute was not found, then the following element names result in a return value oftrue: pre, script, style,andxsl:text. Finally, if aTagTablewas passed in and the element appears as the "pre" element in theTagTable, thentruewill be returned. Otherwise,falseis returned.- Parameters:
element- TheNodeto test to see if whitespace should be preserved.tt- TheTagTableto test for thegetNodePre()function. This may benull, in which case this test is bypassed.- Returns:
trueorfalse, as explained above.
-
parseXMLElement
XML documents. -
parseXMLDocument
-