This documentation is archived and is not being maintained.

Introduction to XML Schemas (XML Designer) 


In versions prior to Visual Studio 2005, the XML Designer is the designer for typed datasets and XML schema. The XML Designer can still be used to create and edit XML schema files. However, in the current version, the designer for creating and editing typed datasets is the Dataset Designer. For more information, see Dataset Designer.

This page assumes you are working with the XML Designer. To open a typed dataset file with the XML Designer, right-click the file in Solution Explorer, point to Open With, and then click XML Schema Editor.

XML Schemas are documents that are used to define and validate the content and structure of XML data, just as a database schema defines and validates the tables, columns, and data types that make up a database.

An XML Schema defines and describes certain types of XML data by using the XML Schema definition language (XSD). XML Schema elements (elements, attributes, types, and groups) are used to define the valid structure, valid data content, and relationships of certain types of XML data. XML Schemas can also provide default values for attributes, and elements. For more information, see the World Wide Web Consortium (W3C) Web site

You use an XML Schema to guarantee consistency among certain types of XML data that is shared between applications and organizations. An XML Schema can be used as a contract for data exchange between two applications. Organizations can publish schemas that describe the format of the XML their applications produce and consume. Other organizations and applications that wish to exchange data can then build their applications around these schemas so their xml messages will be understood.

For example, a purchase order represented in XML can be validated with an XML Schema before it is sent between buyer and seller. This validation verifies that all of the elements (individual pieces) of data exist, are in the expected sequence, and are all of the correct data type. This ensures that the recipient of the purchase order will be able to interpret the data correctly when it is received.

XML Schemas in Visual Studio conform to the W3C recommendation regarding XML Schema based on the XML Schema definition language (XSD). These are some of the advantages that XML Schemas have over previous technologies, such as DTDs:

  • XML Schemas use XML syntax, so you do not need to learn a new syntax to define your data structure.

  • XML Schemas support reusable types and allow you to create new types using inheritance.

  • XML Schemas allows you to group elements to control the recurrence of elements and attributes.

For more information about schemas and how the elements they represent constrain data, see XML Elements, Attributes, and Types.

For more information about XML Schemas, see the XML Schemas (XSD) Reference and MSDN Online XML Developer Center

See Also