Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----com.ibm.xml.parser.Child | +----com.ibm.xml.parser.Attlist
We will use the following example to illustrate the capabilities of attribute lists within a PERSON Element:
<!ATTLIST PERSON EMPLOYEETYPE CDATA "PERMANENT" LASTNAME CDATA #REQUIRED PHONE ENTITY #IMPLIED COMPANY CDATA #FIXED "IBM" >
In this example, the attributes EMPLOYEETYPE
and COMPANY
have
been assigned default values; EMPLOYEETYPE
's default value may be changed, but
COMPANY
's value is fixed and may not be changed.
The LASTNAME
attribute must be specified with each PERSON
Element
because this attribute is defined as REQUIRED
.
Just because an attribute is not defined by the attribute list definition, it does not
mean that the attribute can not be defined in the document. These attributes are known
as IMPLIED
attributes. However, you will need to explicitly define IMPLIED
attributes if you want them to have a value type other than CDATA
.
Value types are defined as follows:
IDREF
except multiple pointers may be provided.
ENTITY
except multiple pointers may be provided.
NMTOKEN
except multiple names may be provided.
NMTOKEN
tokens.
Fields inherited from class com.ibm.xml.parser.Child |
ATTDEF, ATTLIST, DOCUMENTTYPE, ELEMENTDEFINITION, ENTITY, GENERALREFERENCE, NOTATION, PSEUDONODE |
Constructor Summary | |
Attlist(java.lang.String name)
|
Method Summary | |
boolean | addElement(AttDef attDef)
|
java.lang.Object | clone()
|
boolean | contains(java.lang.String attDefName)
|
AttDef | elementAt(int index)
|
java.util.Enumeration | elements()
|
AttDef | getAttDef(java.lang.String attDefName)
|
java.lang.String | getName()
|
int | getNodeType()
|
int | size()
|
Methods inherited from class com.ibm.xml.parser.Child |
clearDigest, clone, getChildNodes, getDigest, getFactory, getFirstChild, getNextSibling, getParentNode, getPreviousSibling, getText, hasChildNodes, insertBefore, makeXPointer, print, print, removeChild, replaceChild, searchAncestors, searchAncestors, setFactory, toString, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Attlist(java.lang.String name)
name
- This attribute list's name; this value is also known as the Element type.
Method Detail |
public java.lang.Object clone()
public int getNodeType()
This method is defined by DOM.
public java.lang.String getName()
public boolean addElement(AttDef attDef)
attDef
- Attribute definition to add to this atribute list.
public AttDef elementAt(int index)
index
- Index into this list of attribute definitions.
public AttDef getAttDef(java.lang.String attDefName)
attDefName
- Attribute definition name to match in this attribute list.
public boolean contains(java.lang.String attDefName)
attDefName
- Attribute definition name to match in this attribute list.
public int size()
public java.util.Enumeration elements()
Contents | Package | Class | Tree | Deprecated | Index | Help | |||
PREV | NEXT | SHOW LISTS | HIDE LISTS |