Programmer's Guide > Interfaces > W3C TypeInfo interface
  
W3C TypeInfo interface
The TypeInfo interface is defined in the W3C Document Object Model (DOM) Level 2 Core Specification. (Refer to http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113.)
The TypeInfo interface represent a type referenced from Element or Attr nodes, specified in the schemas associated with the document. The type is a pair of a namespace URI and name properties, and depends on the document's schema.
If the document's schema is an XML DTD [XML 1.0], the values are computed as follows:
If this type is referenced from an Attr node, typeNamespace is null and typeName represents the [attribute type] property in the [XML Information Set]. If there is no declaration for the attribute, typeName is null.
If this type is referenced from an Element node, the typeNamespace and typeName are null.
If the document's schema is an XML Schema [XML Schema Part 1], the values are computed as follows using the post-schema-validation infoset contributions (also called PSVI contributions):
If the [validity] property exists AND is "invalid" or "notKnown": the {target namespace} and {name} properties of the declared type if available, otherwise null.
* 
At the time of writing, the XML Schema specification does not require exposing the declared type. Thus, DOM implementations might choose not to provide type information if validity is not valid.
If the [validity] property exists and is "valid":
If [member type definition] exists, then expose the {target namespace} and {name} properties of the [member type definition] property;
If the [member type definition namespace] and the [member type definition name] exist, then expose these properties.
If the [type definition] property exists, then expose the {target namespace} and {name} properties of the [type definition] property;
If the [type definition namespace] and the [type definition name] exist, then expose these properties.
* 
At the time of writing, the XML Schema specification does not define how to expose anonymous types. If future specifications define how to expose anonymous types, DOM implementations can expose anonymous types via typeName and typeNamespace parameters.
* 
Other schema languages are outside the scope of the W3C and therefore should define how to represent their type systems using TypeInfo.