Re: xml syntax issues

> class Person
>     property mother : Person
>     property father: Person
>
> I propose to make Person a complexType:
>
> complexType name="Person"
>   sequence
>     element name="name" type="xsd:string"
>     element name="mother" type="Person" minOccurs="0"
>     element name="father" type="Person" minOccurs="0"
>
> element name="Person" type="Person"   // need this for document root
>
> This skips the "type stripe":
> <Person>
>   <name>Gary</name>
>   <mother><name>Dorothy</name></mother>
>   <father><name>Henry</name></father>
> <Person>
>
>   
I guess this is the best solution. May be just make global elements: 
name, mother and father...

 <xs:element name="Person" type="Person"/>
 <xs:element name="father" type="Person"/>
 <xs:element name="mother" type="Person"/>
 <xs:element name="name" type="xs:string"/>
 <xs:complexType name="Person">
  <xs:sequence>
  <xs:element ref="name"/>
   <xs:element ref="father" minOccurs="0"/>
   <xs:element ref="mother" minOccurs="0"/>
  </xs:sequence>
 </xs:complexType>

Received on Tuesday, 29 May 2007 07:57:38 UTC