Alex Rivera | Logout

Alternative to xsd.exe in Visual Studio 2010

Asked 2010-02-26T13:25:58.200
23

Looks like XSD.exe is not delivered as a part of Visual Studio 2010.

what is the alternative being offered in VS2010?

Edit
Report

2 Answers

4

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" ma
answered 2013-06-23T18:37:16.620
1

I 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 /? 
answered 2013-03-15T13:40:20.447

Your Answer