Intro
FAQ
Features
Limitations
The basics
XSD vs Dingo
Class Diagram
NUnit Tests
Java code
SourceForge
Plugins
Custom Builders
Tutorial
quicktips
Samples
conversion
dashSchema
contact
foobar
geneology
Links
NUnit
|
|
dashSchema
Files in contact sample:
- helloworld.cs - root class
- hellowroldType.cs - complexType which helloworld extends
- dashSchema.csproj - VS.NET project file
- dashSchema.sln - solution for project
- Test - simple test class to load the sample data
- xml - directory containing the schema and sample data
Step-by-step Instructions
- Open a DOS shell
- change to "Dingo/bin/" directory. Example: cd c:\Dingo\bin\
- copy dashSchema.xsd to the bin directory
- compile the schema with "dingo dashSchema.xsd" command
- copy the generated files to "Dingo/samples/dashSchema/" directory and replace the existing files. The files should be the same.
- open the contact project
- open Test.cs class in VS.NET
- build the project
- open a second DOS shell
- change to "Dingo/samples/dashSchema/bin/" directory
- run the test with "test.exe" command
This example tests how Dingo handles dashes "-" in the name. Since dashes are not legal characters for class names, Dingo and other schema compilers strip it out. The attribute then has to declare the type using the original dash name.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="hello-worldType">
<xs:sequence>
<xs:element name="input" type="xs:string" maxOccurs="unbounded"/>
<xs:element name="output" type="xs:string" maxOccurs="unbounded"/>
<xs:element name="input-message" type="message"/>
<xs:element name="output-message" type="message" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="message">
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:element name="helloworld" type="hello-worldType"/>
</xs:schema>
|
|