Next in thread → Next in month →

Re: [xml-dev] Venetian Blinds vs Garden of Eden patterns for industry standards XML Schemas

From
Mukul Gandhi <>
To
Pete Cordell <>
Date
2010-10-30T01:02:26Z
ID
<>
Thread
Re: [xml-dev] Venetian Blinds vs Garden of Eden patterns for industry standards XML Schemas
Hi Pete,
    Why can't we use a schema like below for this need (using
elementFormDefault="qualified").

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                   targetNamespace="http://opportunities.org"
                   elementFormDefault="qualified">

   <xs:element name="availability">
       <xs:complexType>
           <xs:sequence>
              <xs:element name="from" type="DATE" />
              <xs:element name="to" type="DATE" />
              <xs:element name="person" type="PERSON" />
           </xs:sequence>
       </xs:complexType>
   </xs:element>

   <xs:complexType name="DATE">
        <xs:sequence>
            <xs:element name="day" type="xs:int" />
            <xs:element name="month" type="xs:int" />
            <xs:element name="year" type="xs:int" />
        </xs:sequence>
   </xs:complexType>

   <xs:complexType name="PERSON">
       <xs:sequence>
            <xs:element name="name" type="xs:string" />
            <xs:element name="height" type="xs:int" />
       </xs:sequence>
   </xs:complexType>

</xs:schema>

On Fri, Oct 29, 2010 at 2:08 AM, Pete Cordell <> wrote:
> It would be cleaner if the XML instance used elementFormDefault="unqualified" and looked like:
>
> <availability xmlns="http://opportunities.org" >
>   <from>
>       <day>21</day>
>       <month>12</month>
>       <year>2012</month>
>   </from>
>   <to>
>       <day>24</day>
>       <month>12</month>
>       <year>2012</month>
>   </to>
>   <person>
>       <name>Janice</name>
>       <height>185</height>
>   </person>
> </availability>
>
> So how would you attack the problem of the above?




-- 
Regards,
Mukul Gandhi
Next in thread → Next in month →