TypeInfo interface represents 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:
Attr node, typeNamespace is
"http://www.w3.org/TR/REC-xml" and typeName
represents the [attribute type] property in the [XML Information Set]
. If there is no declaration for the attribute, typeNamespace
and typeName are null.
Element node, 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):
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.
Note
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.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DERIVATION_EXTENSION
If the document's schema is an XML Schema [XML Schema Part 1] , this constant represents the derivation by extension. |
| public static final int | DERIVATION_LIST
If the document's schema is an XML Schema [XML Schema Part 1] , this constant represents the list. |
| public static final int | DERIVATION_RESTRICTION
If the document's schema is an XML Schema [XML Schema Part 1] , this constant represents the derivation by restriction if complex types are involved, or a restriction if simple types are involved. |
| public static final int | DERIVATION_UNION
If the document's schema is an XML Schema [XML Schema Part 1] , this constant represents the union if simple types are involved. |
| Modifier and Type | Method and Description |
|---|---|
| public String | getTypeName()
The name of a type declared for the associated element or attribute,
or |
| public String | getTypeNamespace()
The namespace of the type declared for the associated element or
attribute or |
| public boolean | Returns: If the document's schema is a DTD or no schema is associated with the document, this method will always returnfalse
. If the document's schema is an XML Schema, the method will return
true if the reference type definition is derived from
the other type definition according to the derivation parameter. If
the value of the parameter is 0 (no bit is set to
1 for the derivationMethod parameter),
the method will return true if the other type
definition can be reached by recursing any combination of {base
type definition}, {item type definition}, or {member type
definitions} from the reference type definition.the namespace of the other type definition. typeNamespaceArg, String the name of the other type definition. typeNameArg, int the type of derivation and conditions applied
between two types, as described in the list of constants provided
in this interface. derivationMethod)This method returns if there is a derivation between the reference
type definition, i.e. the |
| DERIVATION_EXTENSION | back to summary |
|---|---|
| public static final int DERIVATION_EXTENSION If the document's schema is an XML Schema [XML Schema Part 1]
, this constant represents the derivation by
extension.
| |
| DERIVATION_LIST | back to summary |
|---|---|
| public static final int DERIVATION_LIST If the document's schema is an XML Schema [XML Schema Part 1]
, this constant represents the list.
| |
| DERIVATION_RESTRICTION | back to summary |
|---|---|
| public static final int DERIVATION_RESTRICTION If the document's schema is an XML Schema [XML Schema Part 1]
, this constant represents the derivation by
restriction if complex types are involved, or a
restriction if simple types are involved.
| |
| DERIVATION_UNION | back to summary |
|---|---|
| public static final int DERIVATION_UNION If the document's schema is an XML Schema [XML Schema Part 1]
, this constant represents the
union if simple types are involved.
| |
| getTypeName | back to summary |
|---|---|
| public String getTypeName() The name of a type declared for the associated element or attribute,
or | |
| getTypeNamespace | back to summary |
|---|---|
| public String getTypeNamespace() The namespace of the type declared for the associated element or
attribute or | |
| isDerivedFrom | back to summary |
|---|---|
| public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod) This method returns if there is a derivation between the reference
type definition, i.e. the
| |