NAntContrib Help Task Reference <xsd> | v0.85-rc1 |
[This is preliminary documentation and subject to change.]
The <xsd> task generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly.
The following operations can be performed :
Operation | Description |
---|---|
XDR to XSD | Generates an XML schema from an XML-Data-Reduced schema file. XDR is an early XML-based schema format. |
XML to XSD | Generates an XML schema from an XML file. |
XSD to DataSet | Generates common language runtime DataSet classes from an XSD schema file. The generated classes provide a rich object model for regular XML data. |
XSD to Classes | Generates runtime classes from an XSD schema file. The generated classes can be used in conjunction with XmlSerializer to read and write XML code that follows the schema. |
Classes to XSD | Generates an XML schema from a type or types in a runtime assembly file. The generated schema defines the XML format used by XmlSerializer. |
Attribute | Type | Description | Required |
---|---|---|---|
assembly | file | Assembly (.dll or .exe) to generate an XML Schema for. | False |
element | string | XML element in the Schema to process. | False |
language | string | The language to use for the generated code - either CS , VB , JS , VJC or the fully-qualified name of a class implementing CodeDomProvider. |
False |
namespace | string | Specifies the runtime namespace for the generated types. The default namespace is Schemas . |
False |
outputdir | directory | The output directory in which to place generated files. | False |
schema | file | XML Schema (.xsd) filename. | False |
target | string | Target of XML Schema compilation - either classes or dataset . The default is classes . |
False |
types | string | Types in the assembly for which an XML schema is being created. By default all types in the assembly will be included. | False |
uri | string | Specifies the URI for the elements in the schema to generate code for. |
False |
xdr | file | XDR Schema to generate an XML Schema for. | False |
xmldoc | file | XML document to generate an XML Schema for. | False |
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False |
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False |
timeout | int | The maximum amount of time the application is allowed to execute, expressed in milliseconds. Defaults to no time-out. | False |
unless | bool | Opposite of if . If false then the task will be executed; otherwise, skipped. The default is false. |
False |
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False |
Attribute | Type | Description | Required |
---|---|---|---|
exename | string | The name of the executable that should be used to launch the external program. | False |
useruntimeengine | bool | Specifies whether the external program should be executed using a runtime engine, if configured. The default is false. | False |
Contains a collection of Argument elements.
Compile a XML Schema.
<xsd schema="MySchema.xsd" element="MyRootElement" language="CS" namespace="MyCompany.MySchema" outputdir="build\bin" uri="http://MySchema'sTargetNamespace" />
Generate an XML Schema from an assembly.
<xsd assembly="MyAssembly.dll" outputdir="build\Schemas" />
Generate an XML Schema from an XML document.
<xsd xmldoc="MyDoc.xml" outputdir="build\Schemas" />
Generate an XML Schema from an XDR Schema.
<xsd xdr="MyOldSchema.xdr" outputdir="build\Schemas" />