<document>
Section that describes the structure of the document and attributes of the elements. This information is used to validate a document and to control code generate on specific elements in the document.
Context:
Content:<elementDef>
Define a particular element in the document. An <elementDef>
uniquely address a particular element in the document.
This is done with by specifying the element's id in the
elementId
attribute.
In HTML, this is the ID
attribute of
addressed element. In XML, this is the attribute that is
defined to be of type ID
(usually named
id
by convention).
The nesting of element definitions places constraints on the location
of an element in the document.
A <elementDef>
directly contained in the
<document>
section indicates that the element can occur
anywhere in the document. An <elementDef>
contained
in another <elementDef>
indicates that that
element must be a descendent of the containing element.
However, it does not have to be a direct descendent; they maybe intervening
elements and the constraint still be satisfied.
Attributes:
elememtId
- The id of the element in the document.
tagNames
- The list of tag names for this element.
The element can be any of these actual elements in the document.
This is useful for allowing different legal representations of the
document. If not specified, no restriction is places on the tag name.
domType
- The DOM class to associate with access methods
for the element. This is the type return by the getElementXXX()
method. The actually DOM class associated with this element (as create
by Document.createElement
) must be assignment-compatible
to this type for all valid tag names. For a HTML document, this would
normally be org.w3c.dom.html.HTMLElement
to support
different tag names.
javaName
- The Java name to use in constructing access
methods. This name consists of characters that may be part of a Java
identifier as other than the first character. If omitted, the
id will be converted to a name with its first letter converted to
upper case. If this does not form a legal Java identifier, an
error is generate if any access method is to be created.
createSetText
- Boolean indicating if an access method that
sets the first text child of the node is to be created. If not
specified, a method is only created for element's whose content model
contain #PCDATA, has at least one Text descent, and has an id attribute
that is a legal Java identifier. The access method has the signature:
void setTextJavaName(String value);
createGetElement
- Boolean indicating if an access method
that returns a reference to the element to be created.
domType getElementJavaName();
optional
- Boolean indicating if this element is optional.
If true, then the element will not be required to be present in the document.
If its not present, none of its constrained descendents maybe present.
If the element does not exist, the getElement
method
will return null and the setText
method will
generate an error.
<tagClass/>
Defines the attribute name that is to considered as the class
attribute.
This is used for XML, and is analogous to the HTML CLASS
attribute.
The class attributes value is a white-spaces separate list of class names.
If a particular tag name is not specified,
then the attribute name is used for all tags that don't have an explicitly
defined class attribute.
A tag may have only one class attribute.
The attribute must be defined as type Nmtokens
.
Attributes:
tagName
- The name of the tag. If omitted, this
attrName
- The attribute name. As a convention,
the name class
is suggested.