Summary
The
NAnt.Contrib.Tasks.XsdTask generates XML schema or common language runtime
classes from XDR, XML, and XSD files, or from classes in a runtime assembly.
- Assembly
- NAnt
.Contrib .dll - Namespace
- NAnt
.Contrib .Tasks - Base Types
-
- ExternalProgramBase
graph BT
Type-->Base0["ExternalProgramBase"]
Type["XsdTask"]
class Type type-node
Syntax
[TaskName("xsd")]
[ProgramLocation(LocationType.FrameworkSdkDir)]
public class XsdTask : ExternalProgramBase
Examples
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" />
Remarks
The following operations can be performed :
| Operation |
|---|
| XDR to XSD |
| XML to XSD |
| XSD to DataSet |
| XSD to Classes |
| Classes to XSD |
Attributes
| Type | Description |
|---|---|
| TaskName | |
| ProgramLocation |
Properties
| Name | Value | Summary |
|---|---|---|
| Assembly | FileInfo |
Assembly (.dll or .exe) to generate an XML Schema for.
|
| Element | string |
XML element in the Schema to process.
|
| Language | string |
The language to use for the generated code - either
CS,
VB, JS, VJC or the fully-qualified name of a
class implementing System.CodeDom.Compiler.CodeDomProvider.
|
| Managed | ManagedExecution |
Gets a value indiciating whether the external program is a managed
application which should be executed using a runtime engine, if
configured.
|
| Namespace | string |
Specifies the runtime namespace for the generated types. The default
namespace is
Schemas.
|
| OutputDir | DirectoryInfo |
The output directory in which to place generated files.
|
| ProgramArguments | string |
Gets the command-line arguments for the external program.
|
| Schema | FileInfo |
XML Schema (.xsd) filename.
|
| Target | string |
Target of XML Schema compilation - either
classes or
dataset. The default is classes.
|
| Types | string |
Types in the assembly for which an XML schema is being created.
By default all types in the assembly will be included.
|
| Uri | string |
Specifies the URI for the elements in the
NAnt.Contrib.Tasks.XsdTask.Schema to
generate code for.
|
| Xdr | FileInfo |
XDR Schema to generate an XML Schema for.
|
| XmlDoc | FileInfo |
XML document to generate an XML Schema for.
|
Methods
| Name | Value | Summary |
|---|---|---|
| ExecuteTask |
void | |
| Initialize |
void |
Validates the
Task.
|
