All Packages Class Hierarchy This Package Previous Next Index
Class w3c.xmlOnline.tree.TreeListener
java.lang.Object
|
+----w3c.xmlOnline.tree.TreeListener
- public class TreeListener
- extends Object
- implements XMLListener
A class that implements the XMLListener interface
and uses it to build a tree corresponding to the
XML document that is parsed.
- Version:
- $Id: w3c.xmlOnline.tree.TreeListener.html,v 1.7 1997/06/09 22:26:24 bbos Exp $
- Author:
- Bert Bos
- See Also:
- Parser
-
TreeListener()
-
-
doComments(boolean)
- Set a flag that determines whether comments are stored or ignored.
-
doPIs(boolean)
- Set a flag that determines whether PIs are stored or ignored.
-
handleAttribute(String, String)
- This function is called by the parser when it has
recognized an attribute name/value pair.
-
handleComment(String)
- This function is called by the parser when it has
recognized a comment.
-
handleData(String)
- This function is called by the parser when it has
recognized character data.
-
handleEndDoc(String)
- This function is called by the parser when it has
recognized the end of a document or sub-document.
-
handleEndTag(String)
- This function is called by the parser when it has
recognized an end tag or the end of an empty tag.
-
handlePI(String)
- This function is called by the parser when it has
recognized a processing instruction.
-
handleStartDoc(String, String)
- This function is called by the parser when it has
recognized a doctype declaration.
-
handleStartTag(String)
- This function is called by the parser when it has
recognized a start tag.
-
root()
- Return the root of the XML tree
TreeListener
public TreeListener()
doComments
public TreeListener doComments(boolean on)
- Set a flag that determines whether comments are stored or ignored.
By default, comments are not stored (on = false).
- Parameters:
- on - if true, store comment nodes
- Returns:
- this
doPIs
public TreeListener doPIs(boolean on)
- Set a flag that determines whether PIs are stored or ignored.
By default, PIs are not stored (on = false).
- Parameters:
- on - if true, store PI nodes
- Returns:
- this
root
public Root root()
- Return the root of the XML tree
handleComment
public void handleComment(String comment)
- This function is called by the parser when it has
recognized a comment.
- Parameters:
- comment - the comment string (without <!-- -->)
handleStartTag
public void handleStartTag(String tag)
- This function is called by the parser when it has
recognized a start tag.
- Parameters:
- tag - the tag name in lowercase
handleAttribute
public void handleAttribute(String attribute,
String value)
- This function is called by the parser when it has
recognized an attribute name/value pair. The attribute
belongs to the tag that was handled by the most recent
call to handleStartTag().
Note that there is no indication of whether this
attribute was actually on the tag, or whether it
is the declared default value for the attribute on
this tag (<?XML DEFAULT...?>)
- Parameters:
- attribute - the name of the attribute in lowercase
- value - the value of the attribute (a string)
handleEndTag
public void handleEndTag(String tag)
- This function is called by the parser when it has
recognized an end tag or the end of an empty tag.
- Parameters:
- tag - the name of the tag in lowercase
handleData
public void handleData(String data)
- This function is called by the parser when it has
recognized character data. The function may be called
several times without intervening calls to handleStartTag()
or handleEndTag(). The content of an element is thus the
concatenation of all consecutive calls to handleData().
- Parameters:
- data - the character data
handlePI
public void handlePI(String pi)
- This function is called by the parser when it has
recognized a processing instruction.
- Parameters:
- pi - the processing instruction (without <? ?>)
handleStartDoc
public void handleStartDoc(String name,
String doctype)
- This function is called by the parser when it has
recognized a doctype declaration.
- Parameters:
- root - the name of the start tag
- doctype - the URL defining the document type (may be null)
handleEndDoc
public void handleEndDoc(String root)
- This function is called by the parser when it has
recognized the end of a document or sub-document.
- Parameters:
- root - the name of the start tag
All Packages Class Hierarchy This Package Previous Next Index