All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.xml.parser.v2.DTD

java.lang.Object
   |
   +----oracle.xml.parser.v2.XMLNode
           |
           +----oracle.xml.parser.v2.DTD

public class DTD
extends XMLNode
implements DocumentType, Serializable
Implements the DOM DocumentType interface and holds the Document Type Definition information for an XML document.


Method Index

 o cloneNode(boolean)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 o findElementDecl(String)
Finds an element declaration for the given tag name.
 o findEntity(String, boolean)
Finds a named entity in the DTD.
 o findNotation(String)
Retrieves the named notation from the DTD.
 o getChildNodes()
A NodeList that contains all children of this node.
 o getElementDecls()
A NamedNodeMap containing the element declarations in the DTD.
 o getEntities()
A NamedNodeMap containing the general entities, both external and internal, declared in the DTD.
 o getName()
Gets the name of the DTD; i.e., the name immediately following the DOCTYPE keyword.
 o getNotations()
A NamedNodeMap containing the notations declared in the DTD.
 o getPublicId()
Gets The public identifier associated with the DTD, if specified.
 o getSystemId()
Gets the system identifier associated with the DTD, if specified.
 o hasChildNodes()
This is a convenience method to allow easy determination of whether a node has any children.
 o printExternalDTD(OutputStream)
Writes the contents of this document to the given output stream.
 o printExternalDTD(OutputStream, String)
Writes the contents of the external DTD to the given output stream.
 o printExternalDTD(PrintWriter)
Writes the contents of this document to the given output stream.

Methods

 o getName
 public String getName()
Gets the name of the DTD; i.e., the name immediately following the DOCTYPE keyword.

Returns:
Name of the DTD
 o getEntities
 public NamedNodeMap getEntities()
A NamedNodeMap containing the general entities, both external and internal, declared in the DTD. Duplicates are discarded. For example in:<!DOCTYPE ex SYSTEM "ex.dtd" [ <!ENTITY foo "foo"> <!ENTITY bar "bar"> <!ENTITY % baz "baz">]> <ex/> the interface provides access to foo and bar but not baz. Every node in this map also implements the Entity interface.
The DOM Level 1 does not support editing entities, therefore entities cannot be altered in any way.

Returns:
The entities declared in the DTD
 o cloneNode
 public Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent ( parentNode returns null.).
Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning any other type of node simply returns a copy of this node.

Parameters:
deep - If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).
Returns:
The duplicate node.
Overrides:
cloneNode in class XMLNode
 o getNotations
 public NamedNodeMap getNotations()
A NamedNodeMap containing the notations declared in the DTD. Duplicates are discarded. Every node in this map also implements the Notation interface.
The DOM Level 1 does not support editing notations, therefore notations cannot be altered in any way.

Returns:
The notations declared in the DTD
 o getElementDecls
 public NamedNodeMap getElementDecls()
A NamedNodeMap containing the element declarations in the DTD. Every node in this map is an ElementDecl object.

Returns:
The element declarations in the DTD
The DOM Level 1 does not support editing elementdecls, therefore elementdecls cannot be altered in any way.
 o hasChildNodes
 public boolean hasChildNodes()
This is a convenience method to allow easy determination of whether a node has any children. return false always, as DTD cannot have any overrides method in XMLNode

Returns:
false as DTD node can not have any children,
Overrides:
hasChildNodes in class XMLNode
 o getChildNodes
 public NodeList getChildNodes()
A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes. The content of the returned NodeList is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. This is true for every NodeList, including the ones returned by the getElementsByTagName method.

Returns:
The children of this node
Overrides:
getChildNodes in class XMLNode
 o findEntity
 public final Entity findEntity(String n,
                                boolean par)
Finds a named entity in the DTD.

Parameters:
n - The name of the entity.
Returns:
the specified Entity object; returns null if it is not found.
 o findElementDecl
 public final ElementDecl findElementDecl(String name)
Finds an element declaration for the given tag name.

Parameters:
name - The tag name.
Returns:
the element declaration object.
 o findNotation
 public final Notation findNotation(String name)
Retrieves the named notation from the DTD.

Parameters:
name - The name of the notation.
Returns:
the Notation object; returns null if it is not found.
 o getPublicId
 public String getPublicId()
Gets The public identifier associated with the DTD, if specified. If the public identifier was not specified, this is null.

Returns:
the public identifier associated with the DTD
 o getSystemId
 public String getSystemId()
Gets the system identifier associated with the DTD, if specified. If the system identifier was not specified, this is null.

Returns:
the system identifier associated with the DTD
Overrides:
getSystemId in class XMLNode
 o printExternalDTD
 public void printExternalDTD(PrintWriter out) throws IOException
Writes the contents of this document to the given output stream.

Parameters:
out - PrintWriter to write to
Throws: IOException
if an error occurs
 o printExternalDTD
 public void printExternalDTD(OutputStream out) throws IOException
Writes the contents of this document to the given output stream.

Parameters:
out - OutputStream to write to
Throws: IOException
if an error occurs
 o printExternalDTD
 public void printExternalDTD(OutputStream out,
                              String enc) throws IOException
Writes the contents of the external DTD to the given output stream.

Parameters:
out - OutputStream to write to
enc - Encoding to use for the output
Throws: IOException
if an invalid encoding was specified or if any other error occurs

All Packages  Class Hierarchy  This Package  Previous  Next  Index