gnu.xml.dom.html2
Class DomHTMLParser
- DTDConstants
This parser reads HTML from the given stream and stores into
HTMLDocument
. The HTML tag becomes the
Node
.
The tag attributes become the node attributes. The text inside
HTML tag is inserted as one or several text nodes. The nested
HTML tags are inserted as child nodes.
If the strict tree structure, closing the tag means closing all
nested tags. To work around this, this parser closes the nested
tags and immediately reopens them after the closed tag.
In this way,
<b><i>c</b>d
is parsed as
<b><i>c</i></b><i>d
.
protected Node | cursor - The subsequently created new nodes will be inserted as the
childs of this cursor.
|
protected DomHTMLDocument | document - The target where HTML document will be inserted.
|
AP , BEGIN , COMMENT_END , COMMENT_OPEN , COMMENT_TRIPLEDASH_END , DOUBLE_DASH , END , ENTITY , ENTITY_NAMED , ENTITY_NUMERIC , EOF , EQ , EXCLAMATION , NUMTOKEN , OTHER , QUOT , SCRIPT , SCRIPT_CLOSE , SCRIPT_OPEN , SGML , SLASH , STYLE , STYLE_CLOSE , STYLE_OPEN , TAG , TAG_CLOSE , WS , bDIGIT , bLETTER , bLINEBREAK , bNAME , bQUOTING , bSINGLE_CHAR_TOKEN , bSPECIAL , bWHITESPACE |
ANY , CDATA , CONREF , CURRENT , DEFAULT , EMPTY , ENDTAG , ENTITIES , ENTITY , FIXED , GENERAL , ID , IDREF , IDREFS , IMPLIED , MD , MODEL , MS , NAME , NAMES , NMTOKEN , NMTOKENS , NOTATION , NUMBER , NUMBERS , NUTOKEN , NUTOKENS , PARAMETER , PI , PUBLIC , RCDATA , REQUIRED , SDATA , STARTTAG , SYSTEM |
CDATA , Comment , Script , Sgml , Style , Tag , _handleText , append , consume , endTag , error , error , error , error , error , flushAttributes , getAttributes , getCurrentLine , handleComment , handleEOFInComment , handleEmptyTag , handleEndTag , handleError , handleStartTag , handleText , handleTitle , makeTag , makeTag , markFirstTime , mustBe , noValueAttribute , optional , parse , parseDTDMarkup , parseDocument , parseMarkupDeclarations , readAttributes , resolveNamedEntity , resolveNumericEntity , restart , startTag |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
cursor
protected Node cursor
The subsequently created new nodes will be inserted as the
childs of this cursor.
createNode
protected Node createNode(String name)
Create a new node.
name
- the name of node, case insensitive.
handleText
protected void handleText(char[] text)
Handle text by inserting the text node.
- handleText in interface Parser
text
- the text to insert.
DomHTMLParser.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.