Attribute Types

An attribute value can be defined to be of a certain type.

  • Attribute value can only contain character data

    <!ATTLIST element-name attribute-name CDATA>
  • The attribute value can only appear once in the XML Document.

    <!ATTLIST element-name attribute-name ID>
  • References an attribute with an ID value in an XML Document.

    <!ATTLIST element-name attribute-name IDREF>
  • References multiple attributes with an ID value in an XML Document.

    <!ATTLIST element-name attribute-name IDREFS>
  • The attribute value must match the name of an unparsed entity.

    <!ATTLIST element-name attribute-name ENTITY>
  • The attribute value must match a list of names of unparsed entities (separated by spaces).

    <!ATTLIST element-name attribute-name ENTITIES>
  • The attribute value must match a name token.

    <!ATTLIST element-name attribute-name NMTOKEN>
  • The attribute value must match a list of name tokens (separated by spaces).

    <!ATTLIST element-name attribute-name NMTOKENS>
  • Specifies an enumerated value, possible enumerated values are separated by '|'.

    <!ATTLIST element-name attribute-name (yes | no | maybe)>