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 |
Conversion Files in contact sample:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="ecommerce"> <xs:annotation> <xs:documentation>Comment describing your root element</xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element ref="SalesRates" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="SalesRates"> <xs:complexType> <xs:sequence> <xs:element name="SalesRateID" type="xs:string"/> <xs:element name="Rate" type="xs:double"/> <xs:element name="Region" type="xs:string"/> <xs:element name="StageRate" type="stageRate" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="stageRate"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="rate" type="xs:double"/> </xs:sequence> </xs:complexType> </xs:schema> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="ecommerce"> <xs:annotation> <xs:documentation>Comment describing your root element</xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element ref="SalesRates" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="SalesRates"> <xs:complexType> <xs:sequence> <xs:element name="SalesRateID" type="xs:string"/> <xs:element name="Rate" type="xs:double"/> <xs:element name="Region" type="xs:string"/> <xs:element ref="stageRate" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="stageRate"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="rate" type="xs:double"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> The primary difference between the two is the second uses elements with a local complexType. The first example references stageRate as a complexType. In both cases, the mapping in substitution.xml is "stageRate". |
Copyright 2004 Peter Lin |