Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.55 KB

how-to-create-an-xml-schema-from-an-xml-document.md

File metadata and controls

35 lines (23 loc) · 1.55 KB
title description ms.date ms.topic author ms.author manager ms.subservice
Create an XML Schema with the XML editor
Explore how to use the XML editor in Visual Studio to create an XML Schema definition language (XSD) schema from an XML document.
03/05/2019
how-to
dzsquared
drskwier
mijacobs
xml-tools

Create an XML schema from an XML document

The XML editor lets you create an XML Schema definition language (XSD) schema from an XML document. The XML file determines how the schema is generated in the following manner:

  • If the XML document has no schema or Document Type Definition (DTD) associated with it, the data in the XML document is used to infer a new XML Schema.

  • If the XML document contains an associated DTD, the external DTD and internal subset are converted to a corresponding XML Schema.

  • If the XML document contains an inline XML-Data Reduced (XDR) schema, the XDR schema is converted to a corresponding XML Schema.

The schemas that are created are then used to provide IntelliSense for the XML file.

For more information about the schema inference engine, see Infer an XML schema.

To create an XML schema

  1. Open an XML file in Visual Studio.

  2. On the menu bar, choose XML > Create Schema.

    An XML Schema document is created and opened for each namespace found in the XML file. Each schema is opened as a temporary miscellaneous file. The schemas can be saved to disk, added to your project, or discarded.

Related content