Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.xml.parser   Previous This
Package
Next

 


Class DTD

public class DTD
{
  // Constructors
  public DTD();

  // Methods
  public final void addLoadedNameSpace(Name url);
  public final void addNameSpace(Name as, Name href);
  final public void clear();
  public final Enumeration elementDeclarations();
  public final ElementDecl findElementDecl(Name name);
  public final Entity findEntity(Name n);
  public final Name findLoadedNameSpace(Name url);
  public final Name findLongNameSpace(Name as);
  public final Notation findNotation(Name name);
  public final Name findShortNameSpace(Name href);
  final public Name getDocType();
  static public boolean isReservedNameSpace(Name n);
  final public void save(XMLOutputStream o) throws IOException;
}

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

Constructors

DTD

public DTD();

Creates a new empty DTD.

Methods

addLoadedNameSpace

public final void addLoadedNameSpace(Name url);

Adds a specified URL to the list of loaded namespaces.

Return Value:

No return value.

ParameterDescription
url The long name for the namespace.

addNameSpace

public final void addNameSpace(Name as, Name href);

Adds a name pair (long name, short name) to the name space hashtable.

Return Value:

No return value.

ParameterDescription
as The long name part of the namespace.
href The short name part of the namespace.

clear

final public void clear();

Resets the DTD to its initial state.

Return Value:

No return value.

elementDeclarations

public final Enumeration elementDeclarations();

Retrieves an object for enumerating the element declarations.

Return Value:

Returns an Enumeration object that returns ElementDecl objects when enumerated.

findElementDecl

public final ElementDecl findElementDecl(Name name);

Finds an element declaration for the given tag name.

Return Value:

Returns the element declaration object.

ParameterDescription
name The tag name.

findEntity

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.

ParameterDescription
n The name of the entity.

findLoadedNameSpace

public final Name findLoadedNameSpace(Name url);

Determines whether the specified URL is already a loaded namespace so that the caller can decide not to load it again.

Return Value:

Returns true if it is already loaded; otherwise, returns false.

ParameterDescription
url The long name for the namespace.

findLongNameSpace

public final Name findLongNameSpace(Name as);

Retrieves the long name of a specified namespace.

Return Value:

Returns the long name; returns null if it is not found.

ParameterDescription
as The short name of the namespace.

findNotation

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.

ParameterDescription
name The name of the notation.

findShortNameSpace

public final Name findShortNameSpace(Name href);

Retrieves the short name of a specified namespace.

Return Value:

Returns the short name; returns null if it is not found.

ParameterDescription
href The long name of the namespace.

getDocType

final public Name getDocType();

Retrieves the name specified in the DOCTYPE tag.

Return Value:

Returns the name of the document type.

isReservedNameSpace

static public boolean isReservedNameSpace(Name n);

Determines if the given namespace is reserved.

Return Value:

Returns true if reserved; otherwise, returns false.

ParameterDescription
n The namespace to verify.

save

final public void save(XMLOutputStream o) throws IOException;

Saves the DTD information to the given XML output stream.

Return Value:

No return value.

ParameterDescription
o The output stream to write to.

Exceptions:

IOException if there are problems writing to the output stream.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.