.NET Framework Tool XML Architecture Definition Tool (XSD.exe)

xiaoxiao2021-03-06  88

.NET Framework Tool

XML Architecture Definition Tool (XSD.exe) XML Architecture Definition Tool From XDR, XML, and XSD files or from the class in the runtime assembly, the XML schema or public language run library class.

XSD file.xdr [/ outputdir: Directory] xsd file.xml [/ outputdir: Directory] xsd file.xsd {/ classes | / dataset} [/ element: element] [/ language: language] [/ namespace: namespace] [/ Namespace: namespace] [ / OUTPUTDIR: DIRECTORY] [URI: URI] XSD {file.dll | file.exe} [/ outputdir: Directory] [/ type: type [...]] Parameter Description File.extension To convert input files. EXTENSION must be specified as one of the following: .xdr, .xml, .xsd, .dll or .exe. If you specify an XDR schema file (.xdr extension), Xsd.exe converts the XDR architecture into an XSD architecture. The output file is the same name with the XDR architecture, but the extension is .xsd.

If you specify an XML file (.xml extension), Xsd.exe derives the architecture from the data in the file and generates an XSD architecture. The output file is the same name with the XML file, but the extension is .xsd.

If an XML schema file (.xsd extension) is specified, Xsd.exe generates a source code to the run library object corresponding to the XML schema.

If a runtime assembly file (.exe or .dll extension) is specified, Xsd.exe generates a schema for one or more types of the program. You can use the / Type option to specify the type of the architecture to generate the architecture. The output architecture is named schema0.xsd, schema1.xsd, and so on. XSD.exe only produces a multi-architecture when a given type is specified using an XMLRoot Custom Attribute.

General Options Option Description / H [ELP] Displays the command syntax and options for this tool. / o [UtputDir]: Directory specifies the directory of the output file. This parameter can only appear once. The default is the current directory. /? Display the command syntax and options for this tool.

The XSD file option must only specify one of the following options for the XSD file.

Option Description / C [LASSES] Generate classes corresponding to the specified architecture. To read an XML data into an object, use the System.xml.Serialization.xmlSerializer.DeselIzer method. / d [ataset] Generates a class derived from the DataSet, which corresponds to the specified architecture. To read XML data into derived class, use System.Data.DataSet.ReadXML method.

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

Option Description / E [LEMENT]: ELEMENT specifies the element to generate code for it in the schema. By default, type all elements. This parameter can be specified multiple times. / L [Anguage]: Language Specifies the programming language to use. Select from CS (C #; default), VB (Visual Basic), JS (JScript), or VJS (Visual J #). You can also specify a fully qualified name for classes for implementing System.Codedom.compiler.codedomprovider. / n [AMESPACE]: Namespace Specifies the running namespace for the generated type. The default namespace is Schemas. / u [ri]: URI specifies the URI to generate the element generated by the architecture. This URI (if present) is applied to all the elements specified using the / Element option.

DLL and EXE File Options Option Description / T [YPE]: TypeName Specifies the name of the type to create a schema. You can specify multiple types of parameters. If TypeName does not specify a namespace, Xsd.exe matches all types of the program set to the specified type. If TypeName specifies a namespace, only the type is matched. If TypenAme ends in an asterisk character (*), this tool matches all types starting with * before *. If the / type option is omitted, Xsd.exe is a schema that generates all types in the program. Remarks XSD.exe Perform the following:

XDR to XSD generate an XML architecture using a thin XML data architecture file. XDR is an early XML-based architecture format. XML to XSD uses an XML file to generate an XML architecture. XSD to DataSet uses the XSD architecture file to generate a public language runtime DataSet class. The generated class provides a complex object model for rule XML data. XSD to class builds a run library class using an XSD architecture file. The generated class can be used with System.xml.Serialization.xmlSerializer to read and write XML code that follows the architecture. Class to XSD generate an XML architecture using one or more types in the runtime assembly file. The generated architecture defines the XML format used by System.xml.Serialization.xmlSerializer. XSD.exe only allows operations to follow the XML architecture of the XML architecture definition (XSD) language proposed by the World Wide Web Federation (W3C). For more information on the XML architecture definition proposal or XML standard, see http://w3c.org.

Example The following command generates an XML schema from MyFile.xdr and saves it to the current directory.

XSD myfile.xdr The following command generates an XML schema from MyFile.xml and saves it to the specified directory.

XSD myfile.xml / outputdir: myoutputdir The following command generates a DataSet corresponding to the specified architecture in the C # language and saves it as xsdschemafile.cs in the current directory.

XSD / DataSet / Language: CS xsdschemafile.xsd The following command generates an XML schema for all types in Myassembly.dll, and saves them as schema0.xsd in the current directory.

XSD myassembly.dll See .NET Framework Tools | DataSet Class | System.xml.Serialization.xmlSerializer.deSerializer | System.xml.Serialization.xmlSerializer

转载请注明原文地址:https://www.9cbs.com/read-105262.html

New Post(0)