All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.xml.parser.DTD

java.lang.Object
   |
   +----com.ibm.xml.parser.Child
           |
           +----com.ibm.xml.parser.Parent
                   |
                   +----com.ibm.xml.parser.DTD

public class DTD
extends Parent
implements DocumentType
This class represents "<!DOCTYPE ...>"

Version:
19980206

Variable Index

 o CM_ANY
Return value of getContentType(String).
 o CM_EMPTY
Return value of getContentType(String).
 o CM_EOC
A symbol for getInsertableElements() / getAppendableElements().
 o CM_ERROR
A symbol for getInsertableElements() / getAppendableElements().
 o CM_PCDATA
A symbol for getInsertableElements() / getAppendableElements().
 o CM_REGULAR
Return value of getContentType(String).

Method Index

 o addElement(Child)
Add child.
 o checkContent(TXElement)
Check if specified element has correct content.
 o checkID(String)
 o clone()
Clone this instance.
 o getAppendableElements(TXElement, Hashtable)
 o getAttributeDeclaration(String, String)
Return declaration of specified attribute.
 o getAttributeDeclarations(String)
Return all attribute declarations of Element en in Enumeration of AttDef.
 o getChildren()
[DOM] Deprecated.
 o getChildrenArray()
Return internal subset of DTD.
 o getContentType(String)
Return content type of specified element.
 o getElementDeclaration(String)
Return an element declaration.
 o getElementDeclarations()
Return all element declarations in Enumeration of ElementDecl.
 o getElementsByTagName(String)
[DOM] Not implemented. Deprecated.
 o getElementTypes()
[DOM] Not implemented. Deprecated.
 o getEntities()
Return Enumeration of EntityValue.
 o getExternalSubset()
[DOM] Not implemented. Deprecated.
 o getFirstChild()
[DOM] Deprecated.
 o getInsertableElements(TXElement, int, Hashtable)
Make a table which shows what kind of Element you can inset to specified position of Element el.
 o getInternalSubset()
[DOM] Not implemented. Deprecated.
 o getName()
[DOM] Get a root element name.
 o getNodeType()
[DOM] Not impelmented. Deprecated.
 o getNotation(String)
Return a notation with specified name.
 o getNotationEnumeration()
Return notations.
 o getNotations()
[DOM] Not implemented. Deprecated.
 o getText()
Return "".
 o hasChildren()
[DOM] Deprecated.
 o IDs()
Enumerate all IDs.
 o insert(Child, int)
Deprecated.
 o insertBefore(Node, Node)
[DOM] Deprecated.
 o insertBeforeSilently(Node, Node)
Deprecated.
 o isAttributeDeclared(String, String)
Check if declaration of specified attribute exists.
 o isElementDeclared(String)
Check if specified element is declared.
 o prepareTable(String)
Make a table for getInsertableElements() / getAppendableElements().
 o print(PrintWriter, String, int)
Print.
 o registID(Element, String)
 o removeChild(Node)
[DOM] Deprecated.
 o removeChildSilenty(Node)
Deprecated.
 o replaceChild(Node, Node)
[DOM] Deprecated.
 o replaceChildSilently(Node, Node)
Deprecated.
 o setElementTypes(NamedNodeList)
[DOM] Not implemented. Deprecated.
 o setExternalSubset(NodeList)
[DOM] Not implemented. Deprecated.
 o setInternalSubset(NodeList)
[DOM] Not implemented. Deprecated.
 o setName(String)
[DOM] Set a root element name.
 o setNotations(NamedNodeList)
[DOM] Not implemented. Deprecated.

Variables

 o CM_REGULAR
 public static final int CM_REGULAR
Return value of getContentType(String). This means the element has content model like regular expression (including mixed content).

 o CM_EMPTY
 public static final int CM_EMPTY
Return value of getContentType(String). This means the element can has no content.

 o CM_ANY
 public static final int CM_ANY
Return value of getContentType(String). This means the element may has any children.

 o CM_EOC
 public static final String CM_EOC
A symbol for getInsertableElements() / getAppendableElements().

 o CM_ERROR
 public static final String CM_ERROR
A symbol for getInsertableElements() / getAppendableElements().

 o CM_PCDATA
 public static final String CM_PCDATA
A symbol for getInsertableElements() / getAppendableElements().

Methods

 o getNodeType
 public int getNodeType()
Note: getNodeType() is deprecated. Not implemented.

[DOM] Not impelmented.

Overrides:
getNodeType in class Child
 o setName
 public void setName(String name)
[DOM] Set a root element name.

 o getName
 public String getName()
[DOM] Get a root element name.

 o setExternalSubset
 public void setExternalSubset(NodeList externalSubset)
Note: setExternalSubset() is deprecated. Not implemented.

[DOM] Not implemented.

 o getExternalSubset
 public NodeList getExternalSubset()
Note: getExternalSubset() is deprecated. Not implemented.

[DOM] Not implemented.

 o setInternalSubset
 public void setInternalSubset(NodeList internalSubset)
Note: setInternalSubset() is deprecated. Not implemented.

[DOM] Not implemented.

 o getInternalSubset
 public NodeList getInternalSubset()
Note: getInternalSubset() is deprecated. Not implemented.

[DOM] Not implemented.

 o setNotations
 public void setNotations(NamedNodeList notations)
Note: setNotations() is deprecated. Not implemented.

[DOM] Not implemented.

 o getNotations
 public NamedNodeList getNotations()
Note: getNotations() is deprecated. Not implemented.

[DOM] Not implemented.

 o setElementTypes
 public void setElementTypes(NamedNodeList elementTypes)
Note: setElementTypes() is deprecated. Not implemented.

[DOM] Not implemented.

 o getElementTypes
 public NamedNodeList getElementTypes()
Note: getElementTypes() is deprecated. Not implemented.

[DOM] Not implemented.

 o getChildren
 public NodeList getChildren()
Note: getChildren() is deprecated. Not implemented.

[DOM]

Overrides:
getChildren in class Parent
 o hasChildren
 public boolean hasChildren()
Note: hasChildren() is deprecated. Not implemented.

[DOM]

Overrides:
hasChildren in class Parent
 o getFirstChild
 public Node getFirstChild()
Note: getFirstChild() is deprecated. Not implemented.

[DOM]

Overrides:
getFirstChild in class Parent
 o insert
 public void insert(Child ch,
                    int ind)
Note: insert() is deprecated. Not implemented.

Overrides:
insert in class Parent
 o insertBefore
 public void insertBefore(Node newChild,
                          Node refChild)
Note: insertBefore() is deprecated. Not implemented.

[DOM]

Overrides:
insertBefore in class Parent
 o insertBeforeSilently
 public void insertBeforeSilently(Node newChild,
                                  Node refChild)
Note: insertBeforeSilently() is deprecated. Not implemented.

Overrides:
insertBeforeSilently in class Parent
 o replaceChild
 public Node replaceChild(Node oldChild,
                          Node newChild)
Note: replaceChild() is deprecated. Not implemented.

[DOM]

Overrides:
replaceChild in class Parent
 o replaceChildSilently
 public Node replaceChildSilently(Node oldChild,
                                  Node newChild)
Note: replaceChildSilently() is deprecated. Not implemented.

 o removeChild
 public Node removeChild(Node oldChild)
Note: removeChild() is deprecated. Not implemented.

[DOM]

Overrides:
removeChild in class Parent
 o removeChildSilenty
 public Node removeChildSilenty(Node oldChild)
Note: removeChildSilenty() is deprecated. Not implemented.

 o getElementsByTagName
 public NodeEnumerator getElementsByTagName(String name)
Note: getElementsByTagName() is deprecated. Not implemented.

[DOM] Not implemented.

Overrides:
getElementsByTagName in class Parent
 o clone
 public synchronized Object clone()
Clone this instance. Note: checkID() isn't work in the clone.

Overrides:
clone in class Child
See Also:
checkID
 o addElement
 public void addElement(Child a)
Add child.

Overrides:
addElement in class Parent
 o getChildrenArray
 public Child[] getChildrenArray()
Return internal subset of DTD.

Overrides:
getChildrenArray in class Parent
 o getAttributeDeclarations
 public Enumeration getAttributeDeclarations(String en)
Return all attribute declarations of Element en in Enumeration of AttDef.

 o getAttributeDeclaration
 public AttDef getAttributeDeclaration(String en,
                                       String an)
Return declaration of specified attribute.

Parameters:
en - element name
an - attribute name
 o isAttributeDeclared
 public boolean isAttributeDeclared(String en,
                                    String an)
Check if declaration of specified attribute exists.

Parameters:
en - element name
an - attribute name
 o getElementDeclarations
 public Enumeration getElementDeclarations()
Return all element declarations in Enumeration of ElementDecl.

See Also:
ElementDecl
 o getElementDeclaration
 public ElementDecl getElementDeclaration(String ename)
Return an element declaration.

 o isElementDeclared
 public boolean isElementDeclared(String name)
Check if specified element is declared.

 o getNotation
 public Notation getNotation(String n)
Return a notation with specified name.

 o getNotationEnumeration
 public Enumeration getNotationEnumeration()
Return notations.

Returns:
Enumeration of Notation
 o print
 public void print(PrintWriter pw,
                   String enc,
                   int indent)
Print.

Overrides:
print in class Child
 o checkContent
 public boolean checkContent(TXElement t)
Check if specified element has correct content.

Returns:
true if match; false if no <!ELEMENT ...> or if not match
 o getContentType
 public int getContentType(String ename)
Return content type of specified element.

Parameters:
ename - Element name
Returns:
DTD.CM_EMPTY or DTD.CM_ANY or DTD.CM_REGULAR; 0 if specified element is not declared.
 o prepareTable
 public Hashtable prepareTable(String ename)
Make a table for getInsertableElements() / getAppendableElements().

Returns:
null if specified element is not declared.
 o getInsertableElements
 public Hashtable getInsertableElements(TXElement el,
                                        int ind,
                                        Hashtable ht)
Make a table which shows what kind of Element you can inset to specified position of Element el. The Hashtable instance consists of Element names as keys and InsertableElement as values.

Usage:

DTD dtd = ...;
Hashtable tab = dtd.prepareTable(el.getName());
dtd.getInsertableElements(el, n, tab);

You can know following information with tab instance.

ie = (InsertableElement)tab.get(DTD.CM_ERROR)
ie.status means whether el has incorrect contents or not in a subsequence of children [0, n-1]. When ie.status is true, ie.index is an index number of first wrong Element.
ie = (InsertableElement)tab.get(DTD.CM_EOC)
ie.status means whether el has complete contents or not in a subsequence of children [0, n-1]. You might be able to insert elements to el even when ie.status is true.
ie = (InsertableElement)tab.get(DTD.CM_PCDATA)
ie.status == false: You can't insert a TextElement instance to el.
ie.status == true: You can. It doesn't mean el will always have correct contents after inserting a TextElement.
ie = (InsertableElement)tab.get("name")
ie == null: in DTD.CM_ANY, specified element can be inserted. In DTD.CM_EMPTY, specified element can not be inserted. In DTD.CM_REGULAR, specified element can not be inserted.
ie.status == false: You can't insert an Element instance of name to el.
ie.status == true: You can. It doesn't mean el will always have correct contents after inserting an Element.

Returns:
null if the element isn't declared
See Also:
InsertableElement
 o getAppendableElements
 public Hashtable getAppendableElements(TXElement el,
                                        Hashtable ht)
See Also:
getInsertableElements
 o registID
 public boolean registID(Element t,
                         String id)
Returns:
false when id is already registered.
 o checkID
 public Element checkID(String id)
Parameters:
id - ID name
 o IDs
 public Enumeration IDs()
Enumerate all IDs.

Returns:
Enumeration of String
 o getText
 public String getText()
Return "".

Overrides:
getText in class Child
 o getEntities
 public Enumeration getEntities()
Return Enumeration of EntityValue.


All Packages  Class Hierarchy  This Package  Previous  Next  Index