Author Topic: XML Schema generation HowTo  (Read 1288 times)

PeterHeintz

  • EA User
  • **
  • Posts: 867
  • Karma: +52/-18
    • View Profile
XML Schema generation HowTo
« on: November 03, 2004, 06:00:05 am »
I am fiddling around with the XML-Schema generation and I had very quickly some success to design my schema somehow top down.

On the leaves of my tree I get lost. I donít know how to model e.g.

<xs:element name="Doc.Title" maxOccurs="unbounded">
<xs:complexType>
 <xs:simpleContent>
  <xs:extension base="xs:string">
   <xs:attribute ref="Language" use="required"/>
   <xs:attribute name="Status" use="required">
   <xs:simpleType>
    <xs:restriction base="xs:NMTOKEN">
     <xs:enumeration value="UnderDevelopment"/>
     <xs:enumeration value="Released"/>
     <xs:enumeration value="Obsolete"/>
     <xs:enumeration value="Replaced"/>
    </xs:restriction>
   </xs:simpleType>
   </xs:attribute>
  </xs:extension>
 </xs:simpleContent>
</xs:complexType>
</xs:element>
or in other words just a node containing a text node and two attributes.

Any help is welcome.
Best regards,

Peter Heintz

xjecht

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: XML Schema generation HowTo
« Reply #1 on: December 17, 2004, 01:09:02 am »
I have the same problem.  I created complexType, extended from xsd:string a and attribute added. I got this :

<xs:complexType name="objectclass">
<xs:complexContent>
<xs:extension base="xs:string">
<xs:sequence/>
<xs:attributeGroup ref="objectclass.att"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>

- it is not valid - I need nested simpleContent (insted of complexContent), without empty xs:sequence.


« Last Edit: December 17, 2004, 01:09:58 am by xjecht »