An XML data type indicates that the contents of an element can be interpreted both as a string and as a typed value (number, date, and so forth). The data type of an XML element indicates that the element contents can be parsed or interpreted to yield an object more specific than a string. Universal Resource Identifiers (URIs) identify data types. The URI is simply a reference to a section of a document that defines the appropriate parser and storage format to the element.
There are two main contexts for data types. The first occurs when dealing with database application-programming interfaces (APIs) in which all elements with the same name typically contain the same type of contents. For example, all sizes contain integers. The second context occurs when the type of content varies widely from instance to instance. The frequency and flexibility of this context varies according to the software being created. For instance, size could contain the integer 6, or the word "small," or even a formula for computing the size.
Copyright 2001 Sun Microsystems, Inc. All rights reserved. Legal Notice.