public class DTD { // Constructors public DTD(); // Methods public final void addLoadedNameSpace(Atom url); public final void addNameSpace(Atom as, Atom href); final public void clear(); public final Enumeration elementDeclarations(); public final Enumeration entityDeclarations(); public final ElementDecl findElementDecl(Name name); public final Entity findEntity(Name n); public final Atom findLoadedNameSpace(Atom url); public final Atom findLongNameSpace(Atom as); public final Notation findNotation(Name name); public final Atom findShortNameSpace(Atom href); final public Name getDocType(); final public Element getSchema(); static public boolean isReservedNameSpace(Atom n); public final Enumeration notationDeclarations(); final public void save(XMLOutputStream o) throws IOException; }
This class contains all the Document Type Definition (DTD) information for an XML document.
public DTD();Creates a new empty DTD.
public final void addLoadedNameSpace(Atom url);add a loaded name space name to the list
public final void addNameSpace(Atom as, Atom href);add a
pair to the name space hashtable
final public void clear();Resets the DTD to its initial state.
Return Value
No return value.
public final Enumeration elementDeclarations();Retrieves an object for enumerating the element declarations.
Return Value
Returns an >Enumeration object that returns ElementDecl objects when enumerated.
public final Enumeration entityDeclarations();Return an enumeration for enumerating the entities The enumeration returns entity objects.
public final ElementDecl findElementDecl(Name name);Finds an element declaration for the given tag name.
Return Value
Returns the element declaration object.
Parameter Description name The tag name.
public final Entity findEntity(Name n);Finds a named entity in the DTD.
Return Value
Returns the specified Entity object; returns null if it is not found.
Parameter Description n The name of the entity.
public final Atom findLoadedNameSpace(Atom url);keep a list of all name spaces loaded so they are loaded twice if two name spaces happen to refer to the same DTD file
public final Atom findLongNameSpace(Atom as);
public final Notation findNotation(Name name);Retrieves the named XML notation in the DTD.
Return Value
Returns the Notation object; returns null if it is not found.
Parameter Description name The name of the notation.
public final Atom findShortNameSpace(Atom href);get the short name of a specified name space
final public Name getDocType();Retrieves the name specified in the DOCTYPE tag.
Return Value
Returns the name of the document type.
final public Element getSchema();Convert everything stored in the DTD to schema. (Does not retain original order)
static public boolean isReservedNameSpace(Atom n);
public final Enumeration notationDeclarations();Return an enumeration for enumerating the notations The enumeration returns notation objects.
final public void save(XMLOutputStream o) throws IOException;Saves the DTD information to the given XML output stream.
Return Value
No return value.
Parameter Description o The output stream to write to. Exceptions
>IOException if there are problems writing to the output stream.