Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Updated: November 4, 1998
Microsoft is providing this release of XML Schema with data type support, as a technology preview that may be useful for developers interested in building prototypes and gaining experience with schema and rich data types. Microsoft is actively involved in defining the emerging W3C XML schema standard and will track this effort. Developers should note that this version of XML Schema is subject to change.
In Microsoft Internet Explorer 5 Beta, element values can be assigned data types. These data types can be assigned through an XML schema or on the instance.
Previously, XML element values were limited to a single type (String), so developers who wished to process XML documents had to spend time converting all values to a type within their own applications. Typing your XML data will let the parser take care of data type conversions. In addition, because values are assigned a particular data type, changes made to that value will have to conform to that data type. This provides you with a method of validating user input.
To type an element through an XML Schema, one must declare the data type namespace along with the schema namespace at the beginning of the XML Schema:
<Schema xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes">
The dt prefix can now be used within the schema to denote which type attributes hold data type designations:
<ElementType name="NUMBER" dt:type="number"/>
To type an element through the dt attribute on the instance of the element, one must declare the data type namespace at the beginning of the XML document:
<NUMBERS xmlns:dt="urn:schemas-microsoft-com:datatypes">
The dt prefix can now be used on the dt attribute to assign a data type to an instance of an element:
<NUMBERS xmlns:dt="urn:schemas-microsoft-com:datatypes"> <NUMBER dt:dt="number">44533</NUMBER> </NUMBERS>
See Supported Data Types for a list of data types that you can use within your XML documents.
Sorry! The interactive exercises require Internet Explorer 5 Beta .
Did you find this article useful? Gripes? Compliments? Suggestions for other articles? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.