Attribute Defaults

An attribute declaration provides information on whether the attribute's presence is REQUIRED, and if not, how an XML processor is to react if a declared attribute is absent in a document.

  • The attribute must be specified.

    <!ATTLIST element-name attribute-name CDATA #REQUIRED>
  • The attribute does not provide a default value (default).

    <!ATTLIST element-name attribute-name CDATA #IMPLIED>
  • The attribute must always have the default value.

    <!ATTLIST element-name attribute-name CDATA #FIXED "fixed-value">
  • Specifies an enumerated attribute value with a default value of 'no'.

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

Note

An XML Processor will provide the default value for the attribute even when the attribute has not been specified on the element in the XML Document.