PRD Ruleset Example Schema

From RIF
Revision as of 19:46, 20 January 2009 by Christian de Sainte Marie (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Example XML schema for the object model in Changhai's example data set. No guaranty as to correctness: that is my first schema ever!

<?xml version="1.0"?>
   <schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="Customer">
         <xs:complexType>
            <xs:all>
               <xs:element name="name" type="xs:string">
               <xs:element name="adr">
                  <xs:complexType>
                     <xs:element ref="Address"/>
                  </xs:complexType>
               </xs:element>
            </xs:all>
         </xs:complexType>
      <xs:element>
      <xs:element name="Address">
         <xs:complexType>
            <xs:all>
               <xs:element name="city" type="xs:string">
               <xs:element name="zipcode" type="xs:integer">
               <xs:element name="country" type="xs:string">
            </xs:all>
         </xs:complexType>
      <xs:element>
      <xs:element name="Account">
         <xs:complexType>
            <xs:all>
               <xs:element name="num" type="xs:integer">
               <xs:element name="customer_name" type="xs:string">
               <xs:element name="balance" type="xs:decimal">  <!-- no float in DTB yet -->
               <xs:element name="rate" type="xs:decimal">     <!-- no float in DTB yet -->
            </xs:all>
         </xs:complexType>
      <xs:element>
      <xs:element name="LowAccount">
         <xs:complexType>
            <xs:all>
               <xs:element name="num" type="xs:integer">
               <xs:element name="startDate" type="xs:date">
               <xs:element name="endDate" type="xs:date">
            </xs:all>
         </xs:complexType>
      <xs:element>
   </schema>