NAnt Help Task Reference <xsd> | NAnt.Contrib.Tasks () |
Compiles an XML Schema into a Microsoft.NET Assembly containing types that can marshal back and forth from XML elements and the objects that represent them. Also can create a W3C XML schema from an existing Microsoft.NET Assembly, XML document, or an old XDR format schema.
Attribute | Type | Description | Required |
---|---|---|---|
assembly | string | Assembly (.dll or .exe) to generate a W3C XML Schema for. | False |
element | string | XML element in the Schema to process. | False |
language | string | Language of generated code. 'CS', 'VB', 'JS', or the fully-qualified name of a class implementing System.CodeDom.Compiler.CodeDomCompiler. | False |
namespace | string | Microsoft.NET namespace of generated classes. | False |
nologo | bool | Suppresses the banner. | False |
outputdir | string | Output directory in which to place generated files. | False |
schema | string | XML Schema (.xsd) filename. | False |
target | string | Target of XML Schema compilation. Can be "classes" or "dataset". | False |
types | string | Types in the assembly for which an XML schema is being created. If you don't specify this, all types in the assembly will be included. | False |
uri | string | Uri of elements from the Schema to process. | False |
xdr | string | XDR schema to generate a W3C XML Schema for. | False |
xmldoc | string | XML document to generate a W3C XML Schema for. | False |
failonerror | bool | False | |
if | bool | False | |
timeout | int | False | |
unless | bool | False | |
verbose | bool | False |
Attribute | Type | Description | Required |
---|---|---|---|
exename | string | False | |
useruntimeengine | bool | False |
Compile a schema.
<xsd schema="MySchema.xsd" element="MyRootElement" language="CS" namespace="MyCompany.MySchema" outputdir="build\bin" uri="http://MySchema'sTargetNamespace" />
Generate a schema from an Assembly.
<xsd assembly="MyAssembly.dll" outputdir="build\Schemas" />
Generate a schema from an XML doc.
<xsd xmldoc="MyDoc.xml" outputdir="build\Schemas" />
Generate a schema from an XDR schema.
<xsd xdr="MyOldSchema.xdr" outputdir="build\Schemas" />