XML technologies / XML / XML in a Nutshell / DOM reference / Object reference / TypeInfo
(Excerpt from "XML in a Nutshell" by Elliotte Rusty Harold & W. Scott Means)
Starting with DOM Level 3, Element and Attr nodes include a schemaTypeInfo attribute that can reference a TypeInfo object. For valid XML documents, it provides information about an element’s or attribute’s declared datatype. Since DOM is intended to be parser-independent, the object’s contents depend on the schema validation performed, such as XML DTD, XML Schema, RELAX NG and so on. The DOM Level 3 Core specification details the meaning of the typeName and typeNamespace attributes for DTDs and XML schemas.
Attributes
The object TypeInfo has the following attributes:
typeName: DOMString (3)
Returns the declared type name of the element or attribute, depending on the validation method. Returns null, if the type name is unknown. Read-only.
Java binding
public String getTypeName( );
typeNamespace: DOMString (3)
Returns the namespace URI of the type specified by the typeName attribute. An attribute validated against the type xs:date has, for example, the namespace "http://www.w3.org/2001/XMLSchema". Read-only.
Java binding
public String getTypeNamespace( );
Method
The following method is defined for this object:
isDerivedFrom: typeNamespaceArg, typeNameArg, derivationMethod (3)
This method determines the relationship between the target datatype and another datatype, specified by the arguments typeNameArg and typeNamespaceArg. The method returns true, if the target datatype is derived from another datatype by a method specified in the bitmask argument derivationMethod. Otherwise, it returns false. Currently, this method is defined only for validation using an XML schema.
Arguments
typeNamespaceArg: DOMString
The namespace associated with the argument
typeNameArg.typeNameArg: DOMString
The type name to compare with the target type.
derivationMethod: unsigned long
A bitmask specifying the derivation kinds recognized by the method. Valid bitmask values are listed below:
| | |
| | |
| | |
| | |
| | |
Java binding
public boolean isDerivedFrom(String typeNamespaceArg,
String typeNameArg, int derivationMethod);
Copyright © 2005 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "XML in a Nutshell" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de