Microsoft provides a tool with the .NET Framework SDK called XSD, the XML Schemas/DataTypes support utility. With this tool, you can generate schemas from source code, compiled assemblies, and XML documents, as well as generating source code in various .NET languages from schemas.
The XSD command-line syntax shown here is explained in Table 8-1:
xsd.exe filename.ext [argument [...]]
Argument |
Description |
|
This argument specifies the name of the file to use as input. This
can be either a CLR DLL ( |
/classes /c |
When an XSD file is specified, generates source code for classes as
determined by the schema. This argument is mutually exclusive with
|
/dataset /d |
When an XSD file is specified, generates source code for classes that
are subclasses of |
/element:element /e:element |
When an XSD file is specified, this argument specifies which elements
to generate types for. |
/language:language /l:language |
When an XSD file is specified, this argument specifies the language
to generate types in. |
/namespace:namespace /n:namespace |
When an XSD file is specified, this argument specifies the namespace
to create types in. The default is |
/outputdir:outputdir /o:outputdir |
Specifies the directory in which to put output files. The default is
the current directory. Generated schema files are named
|
/uri:uri /u:uri |
When an XSD file is specified, this argument specifies the URI for the elements in the schema to generate code for. |
/type:type /t:type |
When a DLL or EXE file is specified, this argument specifies what
types to generate a schema for. If |
/h /? |
Prints information on how to use XSD. |
/nologo |
Suppresses printing of the XSD copyright statement and version information banner. |
As you can see from the command-line syntax, xsd
can be used to generate either source code or an XML Schema, based on
a variety of inputs. It’s a very useful tool for
generating an XSD based on a .NET type or XML document you have
already written, as well as generating source code for a .NET type
based on an existing XSD.
When an XML-Data-Reduced (XDR) document is specified on the command
line, xsd
generates an equivalent XSD document.
XDR was introduced by Microsoft and the University of Edinburgh in
1998, based on the earlier XML-Data standard which formed the basis
for much of XML Schema.
The most likely reason anyone would need to convert an XDR to an XSD is to support an application using Microsoft’s BizTalk Server. BizTalk Server is an application server supporting workflow and process management.
3.17.5.68