Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  XML (Extensible Markup Language)

XML Schema and Data Types Preview


This document describes technologies available in the Internet Explorer 5 Beta. While we encourage you to evaluate these features and to send us your feedback, please note that these features are subject to change.

Microsoft® Internet Explorer 5 Beta includes a technology preview of XML Schema.

The W3C XML Activity Page Non-MS link states: "While XML 1.0 supplies a mechanism, the Document Type Definition (DTD) for declaring constraints on the use of markup, automated processing of XML documents requires more rigorous and comprehensive facilities in this area. Requirements are for constraints on how the component parts of an application fit together, the document structure, attributes, datatyping, and so on. The W3C XML Schema Working Group is addressing means for defining the structure, content and semantics of XML documents."

This technology preview is based on the XML-Data Non-MS link note submitted to the W3C. XML Schema as implemented in this technology preview can be thought of as the subset of the XML-Data submission that corresponds to the feature set proposed for Document Content Description (DCD)Non-MS link

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.

Unlike the unique document type definition (DTD) syntax, XML Schema allows you to define the rules governing the relations between elements and attributes using a standard XML instance syntax, which can be parsed and managed using XML applications. XML Schema also adds support for namespaces, data types, and such useful features as range constraints.

The definitions in an XML schema are contained within the top-level Schema document element. The Schema document element definition must come from the namespace: xmlns="urn:schema-microsoft-com:xml-data". The namespace declaration is an XML processing instruction (PI) as defined in the W3C XML namespace working draftNon-MS link It is convenient to make the Schema namespace the default namespace to avoid having to prefix all definitions within a schema. This documentation uses the convention that the schema namespace is the default namespace, and omits a prefix from all XML Schema element and attribute names.

The Schema document element in an XML Schema schema document should also contain namespace declarations for any other schemas, such as the namespace that defines the built-in data types for XML Schema.

<Schema name="myschema" xmlns="urn:schema-microsoft-com:xml-data"
                        xmlns:dt="urn:schema-microsoft-com:datatypes">
 <!-- ... -->
</Schema>

The Schema document element can contain any number of top-level declarations. The principal XML Schema elements include ElementType (which declares element types) and AttributeType (which declares attribute types). These elements must have an explicit name attribute that is unique within the schema. The Element and Attribute elements can appear within the ElementType element to constrain the content and/or attributes that can appear in elements of the named type. The ElementType attributes order and group allow you to further establish fine-grained definitions. The minOccurs and maxOccurs attributes allow you to define the number of occurrences of an element or group.

The content for an element of a given element type can be defined as one of four categories: empty (no content), text only, subelements only, or a mix of text and subelements. This choice is expressed in the ElementType attribute named content, which can take the values "empty", "textOnly", "eltOnly", and "mixed", respectively.

Element types and attribute types can constrain their values and contents to be instances of a particular data type, referenced from the datatype element namespace. To use the datatype namespace in a schema, it must be declared within the Schema element. The dt:type attribute can then be used to reference primitive data types. For a complete description of data types, see XML Data types.

Finally, note that in XML, schema files are optional and are not required. Some XML applications do not require validation and do not specify a schema file. For a detailed description and examples of these elements, see the reference topic for each XML Schema element.

XML Schema Technology Preview Elements

The following table describes the XML Schema elements.

Attribute Refers to a declared attribute type that can appear within the scope of the named ElementType element.
AttributeType Defines an attribute type for use within the Schema element.
datatype Specifies the data type for the ElementType or AttributeType element.
description Provides documentation about an ElementType or AttributeType element.
element Refers to a declared element type that can appear within the scope of the named ElementType element.
ElementType Defines an element type for use within the Schema element.
group Organizes content into a group to specify a sequence.
Schema Identifies the start of a schema definition.

XML Data types Support

Support for rich data types is integrated into this technology preview. For more information, see XML Data types.

See Also

XML Data types, XML DOM Reference


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site