XSD tool Introduction

Source: Internet
Author: User

XSDUsage

The XSD tool is located in the directory C: \ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ bin. The XSD tool has many functions, as shown below:

 

1, XDRConvert XSD

Use a simplified XML data architecture file to generate an XML architecture. XDR is an earlier XML-based architecture format.

 

2, XMLConvert XSD

Use an XML file to generate an XML schema.

 

3, XSDConvert DataSet

Use the XSD Schema file to generate the DataSet class of the Common Language Runtime Library. The generated class provides a complex object model for rule XML data.

 

4, XSDConversionClass

Use the XSD Schema file to generate the runtime class. The generated class can be used with System. Xml. Serialization. XmlSerializer to read and write the XML Code following the architecture.

 

5, ClassConvert XSD

Generate the XML schema using one or more types in the Runtime Library Assembly file. The generated Architecture defines the Xml format used by System. XML. Serialization. XmlSerializer.

 

XSDThe syntax format is as follows:

Xsd file. xdr [/outputdir: directory] [/parameters: file. xml]

Xsd file. xml [/outputdir: directory] [/parameters: file. xml]

Xsd file. xsd {/classes |/dataset} [/element: element]

[/EnableLinqDataSet] [/language: language]

[/Namespace: namespace] [/outputdir: directory] [URI: uri]

[/Parameters: file. xml]

Xsd {file. dll | file.exe} [/outputdir: directory] [/type: typename [...] [/parameters: file. xml]

 

Parameter description

The parameter that follows the xsd command is the specified input file to be converted. The input file must specify one of the following extensions:. xdr,. xml,. xsd,. dll, or. exe.

 

1. If an XDR architecture file (. xdr extension) is specified, Xsd.exe converts the XDR architecture to the XSD architecture. The output file has the same name as the XDR architecture, but the extension is. xsd.

 

2. If an XML file (. xml extension) is specified, Xsd.exe exports the schema from the file and generates an XSD Schema. The output file has the same name as the XML file, but the extension is. xsd.

 

3. If an XML schema file (. xsd extension) is specified, Xsd.exe generates source code for the runtime object corresponding to the XML schema.

 

4、if you specify a Runtime Library File (.exe or. dll extension), Xsd.exe generates the architecture for one or more types of the Assembly. You can use the/type option to specify the type of the generated architecture. The output architecture is named schema0.xsd and schema1.xsd. Xsd.exe generates Multiple Architectures only when the given type uses XMLRoot's custom naming space.

 

General options:

/H [elp]

Displays the command syntax and options of the tool.

/O [utputdir]: directory

Specifies the directory of the output file. This parameter can only appear once. The current directory is used by default.

/?

Displays the command syntax and options of the tool.

/P [arameters]: file. xml

Read various operation modes from the specified. xml file. The abbreviation is "/p :". For more information, see the "Remarks" section below.

 

XSDFile Options

Only one of the following options must be specified for the xsd file.

Option description

 

/C [lasses]

Generate the class corresponding to the specified architecture. To read XML data into an object, use the System. Xml. Serialization. XmlSerializer. Deserializer method.

 

/D [ataset]

Generates a class derived from DataSet, which corresponds to the specified architecture. To read XML Data into a derived class, use the System. Data. DataSet. ReadXml method.

 

You can also specify any of the following options for the. xsd file.

Option description:

 

/E [lement]: element

Specifies the elements for generating code for the schema. By default, all elements are entered. You can specify this parameter multiple times.

 

/EnableDataBinding

Implement the INotifyPropertyChanged interface on all generated types to enable data binding. The abbreviation is "/edb ".

 

/EnableLinqDataSet

(Abbreviated form:/eld .) Specify the dataset that can be queried. This option is used when the/dataset option is specified at the same time. For more information, see LINQ to DataSet Overview and Querying Typed DataSets. For general information on using LINQ, see Language-Integrated Query (LINQ ).

 

/F [ields]

Generate Fields instead of generating attributes. Property is generated by default.

 

/L [anguage]: language

Specifies the programming language to use. Select from CS (C # by default), VB (Visual Basic), JS (JScript), or VJS (Visual J. You can also specify the fully qualified name of the class that implements System. CodeDom. Compiler. CodeDomProvider.

 

/N [amespace]: namespace

Specify the runtime namespace for the generated type. The default namespace is Schemas.

 

/Nologo

Undisplay the copyright logo.

 

/Order

Generates an explicit sequence identifier on all particle members.

 

/O [ut]: directoryName

Specifies the output directory of the file to be placed. The current directory is used by default.

 

/U [ri]: uri

Specify a URI for the element in the architecture for which code is to be generated. This URI (if any) applies to all elements specified by the/element option.

 

DLLAnd EXEFile Options

Option description:

 

/T [ype]: typename

Specifies the name of the type for which you want to create a schema. You can specify multiple type parameters. If typename does not specify a namespace, Xsd.exe matches all types in the Assembly with the specified type. If typename specifies a namespace, only that type is matched. If typename ends with a star character (*), this tool matches all types starting with the string before. If the/type option is omitted, Xsd.exe generates the architecture for all types in the Assembly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.