Package org.w3c.tidy
Class ParserImpl
- java.lang.Object
-
- org.w3c.tidy.ParserImpl
-
public final class ParserImpl extends java.lang.ObjectHTML Parser implementation.- Version:
- $Revision: 1100 $ ($Author: aditsu $)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParserImpl.ParseBlockParser for block elements.static classParserImpl.ParseBodyParser for BODY.static classParserImpl.ParseColGroupParser for COLGROUP.static classParserImpl.ParseDefListParser for DEFLIST.static classParserImpl.ParseEmptyParser for empty elements.static classParserImpl.ParseFrameSetParser for FRAMESET.static classParserImpl.ParseHeadParser for HEAD.static classParserImpl.ParseHTMLParser for HTML.static classParserImpl.ParseInlineParser for INLINE.static classParserImpl.ParseListParser for LIST.static classParserImpl.ParseNoFramesParser for NOFRAMES.static classParserImpl.ParseOptGroupParser for OPTGROUP.static classParserImpl.ParsePreParser for PRE.static classParserImpl.ParseRowParser for ROW.static classParserImpl.ParseRowGroupParser for ROWGROUP.static classParserImpl.ParseScriptParser for SCRIPT.static classParserImpl.ParseSelectParser for SELECT.static classParserImpl.ParseTableTagParser for TABLE.static classParserImpl.ParseTextParser for text nodes.static classParserImpl.ParseTitleParser for TITLE.
-
Field Summary
Fields Modifier and Type Field Description static ParserBLOCKparser for block elements.static ParserBODYparser for body.static ParserCOLGROUPparser for colgroup.static ParserDEFLISTparser for definition lists.static ParserEMPTYparser for empty elements.static ParserFRAMESETparser for frameset.static ParserHEADparser for head.static ParserHTMLparser for html.static ParserINLINEparser for inline.static ParserLISTparser for list.static ParserNOFRAMESparser for noframes.static ParserOPTGROUPparser for optgroup.static ParserPREparser for pre.static ParserROWparser for row.static ParserROWGROUPparser for rowgroup.static ParserSCRIPTparser for script.static ParserSELECTparser for select.static ParserTABLETAGparser for table.static ParserTEXTparser for text.static ParserTITLEparser for title.
-
Constructor Summary
Constructors Modifier Constructor Description privateParserImpl()ParserImpl should not be instantiated.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidbadForm(Lexer lexer)errors in positioning of form start or end tags generally require human intervention to fix.(package private) static voidmoveNodeToBody(Lexer lexer, Node node)moves given node to end of body element.protected 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 voidparseTag(Lexer lexer, Node node, short mode)static 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 Detail
-
HTML
public static final Parser HTML
parser for html.
-
HEAD
public static final Parser HEAD
parser for head.
-
TITLE
public static final Parser TITLE
parser for title.
-
SCRIPT
public static final Parser SCRIPT
parser for script.
-
BODY
public static final Parser BODY
parser for body.
-
FRAMESET
public static final Parser FRAMESET
parser for frameset.
-
INLINE
public static final Parser INLINE
parser for inline.
-
LIST
public static final Parser LIST
parser for list.
-
DEFLIST
public static final Parser DEFLIST
parser for definition lists.
-
PRE
public static final Parser PRE
parser for pre.
-
BLOCK
public static final Parser BLOCK
parser for block elements.
-
TABLETAG
public static final Parser TABLETAG
parser for table.
-
COLGROUP
public static final Parser COLGROUP
parser for colgroup.
-
ROWGROUP
public static final Parser ROWGROUP
parser for rowgroup.
-
ROW
public static final Parser ROW
parser for row.
-
NOFRAMES
public static final Parser NOFRAMES
parser for noframes.
-
SELECT
public static final Parser SELECT
parser for select.
-
TEXT
public static final Parser TEXT
parser for text.
-
EMPTY
public static final Parser EMPTY
parser for empty elements.
-
OPTGROUP
public static final Parser OPTGROUP
parser for optgroup.
-
-
Method Detail
-
parseTag
protected static void parseTag(Lexer lexer, Node node, short mode)
- Parameters:
lexer-node-mode-
-
moveToHead
protected static void moveToHead(Lexer lexer, Node element, Node node)
Move node to the head, where element is used as starting point in hunt for head. Normally called during parsing.- Parameters:
lexer-element-node-
-
moveNodeToBody
static void moveNodeToBody(Lexer lexer, Node node)
moves given node to end of body element.- Parameters:
lexer- Lexernode- Node to insert
-
XMLPreserveWhiteSpace
public static boolean XMLPreserveWhiteSpace(Node element, TagTable tt)
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
public static void parseXMLElement(Lexer lexer, Node element, short mode)
XML documents.
-
badForm
static void badForm(Lexer lexer)
errors in positioning of form start or end tags generally require human intervention to fix.
-
-