23
XML Schema Definition Tool is available in the menu "Start":
Start-> All Programs-> Microsoft Visual Studio 2010-> Visual Studio Command Prompt(2010)
You'll see the welcome message a command line:
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
D:\Program Files\Microsoft Visual Studio 10.0\VC>
You can, for example, create an XML scheme from the XML-file.
example.xml:
<?xml version="1.0" encoding="utf-8"?>
<country>
<country_name>France</country_name>
<population>59.7</population>
</country>
To do this, enter the following:
I:\example.xml /outputdir:D:\xml2xsd
In my system, i see the following:
...
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation. All rights reserved.
Writing file 'D:\xml2xsd\example.xsd'.
D:\Program Files\Microsoft Visual Studio 10.0\VC>
In the catalog D:\xml2xsd\ came a such a scheme:
example.xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="country">
<xs:complexType>
<xs:sequence>
<xs:element name="country_name" type="xs:string" minOccurs="0" />
<xs:element name="population" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maI had to add this to my path:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\
(Start > Edit the system environment variables > Environment Variables > Edit 'Path' under 'System variables')
Then I could start the Visual Studio command prompt (2010) and type
xsd.exe /?