AttributeDefinition

AttributeDefinition

Specification

manakai//DOM Extensions > DOM XML Document Type Definition module > The AttributeDefinition interface

Modifications to Node members

[3] The getter of the attributes attribute of an AttributeDefinition object MUST return null.

[9] The getter of the baseURI attribute of an AttributeDefinition object MUST return the baseURI of the ownerDocument of the AttributeDefinition object. Note that it might be null.

[1] The getter of the nodeName attribute of an AttributeDefinition object MUST return the name of the attribute.

[2] The getter of the nodeValue attribute of an AttributeDefinition object MUST return the normalized default value of the attribute.

[4] The getter of the textContent attribute of an AttributeDefinition object MUST behave as if it were an Attr object.

The setter of the textContent attribute of an AttributeDefinition object MUST behave as if the following algorithm is performed:

  1. If the AttributeDefinition object is read-only, then throw an NO_MODIFICATION_ALLOWED_ERR.
  2. Remove any child node the node has.
  3. If the new value is not empty and not null, then create a Text node whose data is the new value and append it to the AttributeDefinition.

Definition groups

[6] The definition group DeclaredValueType contains integers indicating the type of attribute value:

NO_TYPE_ATTR0The attribute value type corresponding to no value in XML Information Set.
CDATA_ATTR1The attribute value type is CDATA.
ID_ATTR2The attribute value type is ID.
IDREF_ATTR3The attribute value type is IDREF.
IDREFS_ATTR4The attribute value type is IDREFS.
ENTITY_ATTR5The attribute value type is ENTITY.
ENTITIES_ATTR6The attribute value type is ENTITIES.
NMTOKEN_ATTR7The attribute value type is NMTOKEN.
NMTOKENS_ATTR8The attribute value type is NMTOKENS.
NOTATION_ATTR9The attribute value type is NOTATION.
ENUMERATION_ATTR10The attribute value is enumeration type.
UNKNOWN_ATTR11The attribute value type is unknown, because no declaration for the attribute has been read but not all declarations processed property would be false.

The type of these constants are unsigned short.

If no attribute type information is provided, or if the source of that information does not distinguish no value and unknown as in XML Information Set, then the NO_TYPE_ATTR value MUST be used.

A newly created AttributeDefinition object by createAttributeDefinition method has declaredType attribute set to NO_TYPE_ATTR.

If the source of the attribute type information does not distinguish no value and / or unknown and CDATA, then the CDATA_ATTR value MUST be used.

[11] In Perl binding, the objects implementing the Attr interface MUST also implement the DeclaredValueType constant group.

[7] The definition group DefaultValueType contains integers indicating the type of default attribute value:

UNKNOWN_DEFAULT0The default value is unknown.
FIXED_DEFAULT1The default value is provided and the attribute is #FIXED to that value.
REQUIRED_DEFAULT2An attribute specification is #REQUIRED for the attribute.
IMPLIED_DEFAULT3The default value is #IMPLIED.
EXPLICIT_DEFAULT4The default value is provided but the attribute is not fixed to it.

The type of these constants are unsigned short.

If the source of the attribute default value type does not distinguish the #IMPLIED default and unknown default, then the IMPLIED_DEFAULT value MUST be used.

A newly created AttributeDefinition object by createAttributeDefinition method has declaredType attribute set to NO_TYPE_ATTR.

Tree-relationship Attributes

[10] The ownerElementTypeDefinition attribute of the AttributeDefinition interface is read-only and of type ElementTypeDefinition. It is the ElementTypeDefinition node which the AttributeDefinition node belong to.

If the AttributeDefinition node is included in the attributeDefinitions list of an ElementTypeDefinition node, then the attribute MUST return the ElementTypeDefinition node. Otherwise, it MUST return null.

This attribute is analogue to the ownerDocumentTypeDefinition attribute for ElementTypeDefinition, Entity, and Notation nodes, or the ownerElement attribute for Attr nodes.

Attributes

[5] The declaredType attribute of an AttributeDefinition object represents the type of the attribute value.

This attribute is read-write. The type of the attribute is unsigned short. It is expected that this attribute has a value from the definition group DeclaredValueType.

The getter MUST return a value associated to this attribute.

The setter MUST throw a NO_MODIFICATION_ALLOWED_ERR DOMException if the AttributeDefinition object is read-only. Otherwise, the setter MUST set the specified value as the value associated to this attribute.

If a parser create an AttributeDefinition object, then it MUST set a value from the DeclaredValueType definition group.

[8] The defaultType attribute of an AttributeDefinition object represents the type of the attribute default value.

This attribute is read-write. The type of the attribute is unsigned short. It is expected that this attribute has a value from the definition group DefaultValueType.

The getter MUST return a value associated to this attribute.

The setter MUST throw a NO_MODIFICATION_ALLOWED_ERR DOMException if the AttributeDefinition object is read-only. Otherwise, the setter MUST set the specified value as the value associated to this attribute.

If a parser create an AttributeDefinition object, then it MUST set a value from the DefaultValueType definition group.

memo