Open SiteSearch 4.1.1
Final

ORG.oclc.xml.parser
Class DTD

java.lang.Object
  |
  +--ORG.oclc.xml.parser.DTD

public class DTD
extends Object

This class contains all the Document Type Definition (DTD) information for an XML document.


Constructor Summary
DTD()
          Creates a new empty DTD.
 
Method Summary
 void addLoadedNameSpace(Atom url)
          add a loaded name space name to the list
 void addNameSpace(Atom as, Atom href)
          add a pair to the name space hashtable
 void clear()
          Resets the DTD to its initial state.
 Enumeration elementDeclarations()
          Retrieves an object for enumerating the element declarations.
 Enumeration entityDeclarations()
          Return an enumeration for enumerating the entities The enumeration returns entity objects.
 ElementDecl findElementDecl(Name name)
          Finds an element declaration for the given tag name.
 Entity findEntity(Name n)
           
 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
 Atom findLongNameSpace(Atom as)
           
 Notation findNotation(Name name)
          Retrieves the named XML notation in the DTD.
 Atom findShortNameSpace(Atom href)
          get the short name of a specified name space
 Name getDocType()
          Retrieves the name specified in the DOCTYPE tag.
 Element getSchema()
          Convert everything stored in the DTD to schema.
static boolean isReservedNameSpace(Atom n)
           
 Enumeration notationDeclarations()
          Return an enumeration for enumerating the notations The enumeration returns notation objects.
 void save(XMLOutputStream o)
          Saves the DTD information to the given XML output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTD

public DTD()
Creates a new empty DTD.
Method Detail

findEntity

public final Entity findEntity(Name n)

findElementDecl

public final ElementDecl findElementDecl(Name name)
Finds an element declaration for the given tag name.
Parameters:
name - The tag name.
Returns:
the element declaration object.

elementDeclarations

public final Enumeration elementDeclarations()
Retrieves an object for enumerating the element declarations.
Returns:
an Enumeration object that returns ElementDecl objects when enumerated.

entityDeclarations

public final Enumeration entityDeclarations()
Return an enumeration for enumerating the entities The enumeration returns entity objects.

notationDeclarations

public final Enumeration notationDeclarations()
Return an enumeration for enumerating the notations The enumeration returns notation objects.

findNotation

public final Notation findNotation(Name name)
Retrieves the named XML notation in the DTD.
Parameters:
name - The name of the notation.
Returns:
the Notation object; returns null if it is not found.

addNameSpace

public final void addNameSpace(Atom as,
                               Atom href)
add a pair to the name space hashtable

findShortNameSpace

public final Atom findShortNameSpace(Atom href)
get the short name of a specified name space

findLongNameSpace

public final Atom findLongNameSpace(Atom as)

isReservedNameSpace

public static boolean isReservedNameSpace(Atom n)

findLoadedNameSpace

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

addLoadedNameSpace

public final void addLoadedNameSpace(Atom url)
add a loaded name space name to the list

getSchema

public final Element getSchema()
Convert everything stored in the DTD to schema. (Does not retain original order)

save

public final void save(XMLOutputStream o)
                throws IOException
Saves the DTD information to the given XML output stream.
Parameters:
o - The output stream to write to.
Returns:
No return value.
Throws:
IOException - if there are problems writing to the output stream.

clear

public final void clear()
Resets the DTD to its initial state.
Returns:
No return value.

getDocType

public final Name getDocType()
Retrieves the name specified in the DOCTYPE tag.
Returns:
the name of the document type.

Open SiteSearch 4.1.1
Final