XML Infoset Schema Defaulted Attributes

This article explains how the XML Information Set (Infoset) handles attribute information items that originate from default values defined in a DTD or XML Schema. In the XML Infoset, defaulted attributes are represented as standard attribute information items attached to an element, but they are specifically marked with a [specified] property set to false to indicate that their values were inferred rather than explicitly written in the source document.

Representation in the Information Set

When an XML processor performs schema or DTD validation, it supplements the document’s Infoset with any missing attributes that have default values declared in the schema. In the resulting Infoset:

Role of the Post-Schema-Validation Infoset (PSVI)

In XML Schema processing, the creation of defaulted attribute items is formalized during the creation of the Post-Schema-Validation Infoset (PSVI). The PSVI augments the basic Infoset by:

  1. Inserting the missing attribute information items with their default values.
  2. Setting the [validation attempted] and [validity] properties to record that the defaulted attribute conforms to the schema.
  3. Attaching type definition properties (such as [type definition]) to supply the data type associated with the default value.

Implications for Applications

Because defaulted attributes are integrated directly into the [attributes] set of an element, standard XML processing technologies—such as XPath, XSLT, and DOM Level 3 Core—can query and access defaulted attributes transparently. Applications requiring knowledge of the original source text can inspect the [specified] property to determine whether the value was provided by the author or generated by the schema processor.