## org.apache.xerces.dom3
Interface TypeInfo

public interface TypeInfo

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. should you be able to return `null` on `name`? for anonymous type? for undeclared elements/attributes? Can schemaType be `null`?

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, `namespace` is `null` and `name` represents the [attribute type] property in the [XML Information set]. If there is no declaration for the attribute, `name` is `null`. Unlike for XML Schema, the name contain the declared type, and does not relate to "validity". If this type is referenced from an `Element` node, the `namespace` and `name` are `null`.

If the document's schema is an XML Schema [XML Schema Part 1], the values are computed as follows (for definitions see Post-Schema Validation infoset):

If the [validity] property exists AND is "invalid" or "notKnown": the {target namespace} and {name} properties of the declared type if available, otherwise null.

Note: 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" the name and namespace computed as follows:

a) If [member type definition] exists, then expose the {target namespace} and {name} properties of the [member type definition] property;

b) If the [member type definition namespace] and the [member type definition name] exist, then expose these properties.

c) If the [type definition] property exists, then expose the {target namespace} and {name} properties of the [type definition] property;

d) If the [type definition namespace] and the [type definition name] exist, then expose these properties.

Note: At the time of writing, the XML Schema specification does not define how to expose annonimous types. If future specifications define how to expose annonimous types, DOM implementations can expose annonimous types via "name" and "namespace" parameters. Other schema languages are outside the scope of the W3C and therefore should define how to represent their type systems using `TypeInfo`.

See also the Document Object Model (DOM) Level 3 Core Specification.

Since:
  DOM Level 3

Method Summary
`java.lang.String` `getTypeName()` The name of a type declared for the associated element or attribute, or `null` if unknown.
`java.lang.String` `getTypeNamespace()` The namespace of the type declared for the associated element or attribute or `null` if the element does not have declaration or if no namespace information is available.

Method Detail

### getTypeName

    public java.lang.String getTypeName()

  The name of a type declared for the associated element or attribute, or `null` if unknown. Implementations may also use `null` to represent XML Schema anonymous types. "name" seems too generic and may conflict. shoud we rename it?

### getTypeNamespace

    public java.lang.String getTypeNamespace()

  The namespace of the type declared for the associated element or attribute or `null` if the element does not have declaration or if no namespace information is available. Implementations may also use `null` to represent XML Schema anonymous types. "namespace" seems too generic and may conflict. shoud we rename it?

Copyright © 1999-2003 Apache XML Project. All Rights Reserved.