All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.xmlOnline.tree.Root

java.lang.Object
   |
   +----w3c.xmlOnline.tree.Node
           |
           +----w3c.xmlOnline.tree.Element
                   |
                   +----w3c.xmlOnline.tree.Root

public class Root
extends Element
The root node of the XML tree corresponds to the document itself. It may have an `extid,' the external ID of the document type, usually a URL that points to a DTD.

Version:
$Id: w3c.xmlOnline.tree.Root.html,v 1.7 1997/06/09 22:26:15 bbos Exp $
Author:
Bert Bos

Constructor Index

 o Root(Node, String, int)
Create a new Root node.

Method Index

 o addID(String, Element)
Add the caller to the idTable, with the given ID as key.
 o dumpTree(PrintStream)
A method to write out the content of the node in correct XML syntax.
 o extID()
Return the external name of the document type.
 o findID(String)
Return the element with a certain ID in the tree around this element.
 o ids()
Return an enumeration of all IDs in the tree.
 o setExtID(String)
Set the external name of the document type.

Constructors

 o Root
 public Root(Node parent,
             String name,
             int nr)
Create a new Root node.

Parameters:
the - parent node
name - the name of this node
nr - the sequence number of the node in the tree
Returns:
the new Root node

Methods

 o setExtID
 public Root setExtID(String ext)
Set the external name of the document type. This is normally a URL.

Parameters:
ext - the external name of the document type
Returns:
this
 o extID
 public String extID()
Return the external name of the document type.

Returns:
the external name of the document type
 o addID
 protected Node addID(String ID,
                      Element elt)
Add the caller to the idTable, with the given ID as key. An element that has an attribute called "ID" will use this method to add itself to the idTable of its root element. If this Root is not the root of the tree, it will pass the request on to its parent, and it will percolate up the tree until it reaches the root of the tree.

Parameters:
ID - the ID of the element to add
elt - the element to add
Returns:
this
Overrides:
addID in class Element
 o findID
 public Node findID(String ID)
Return the element with a certain ID in the tree around this element. If this Root is not the root of the tree, it will pass the request up to the real root.

Parameters:
ID - the ID to look for
Returns:
the element with that ID, or null
Overrides:
findID in class Element
 o ids
 public Enumeration ids()
Return an enumeration of all IDs in the tree. If this Root is not the root of the tree, it will pass the request up to the real root.

Returns:
an enumeration of all IDs in the tree
Overrides:
ids in class Element
 o dumpTree
 public void dumpTree(PrintStream out)
A method to write out the content of the node in correct XML syntax. but no checking is done.

Parameters:
out - the PrintStream to write on
Overrides:
dumpTree in class Element

All Packages  Class Hierarchy  This Package  Previous  Next  Index