xsd - Is this the proper way to added enumerated attributes to a complexType? -


is proper way set attribute enumerated values on complextype availstatusmessagetype. see lot of examples declare complexcontent section right below complextype declaration? complexcontent , necessary here?

<xs:complextype name="availstatusmessagetype">     <xs:sequence>     <xs:element name="lengthsofstay" type="lengthsofstaytype" />     <xs:element name="restrictionstatus" type="restrictionstatustype"/> </xs:sequence> <xs:attribute name="bookinglimit"> <xs:simpletype>     <xs:restriction base="xs:string">         <xs:enumeration value="setlimit" />         <xs:enumeration value="adjustlimit"/>         <xs:enumeration value="removelimit"/> </xs:restriction> </xs:simpletype> </xs:attribute> </xs:complextype> 

element types can divided 2 categories in xml schemas

  1. elements can contain structural markup (attributes or child elements)
  2. elements contain textual markup

further, elements contain markup (group 1) can again divided 2 groups

  1. elements allowed have child elements
  2. elements not allowed have child elements

first division separates (1) <complextype> , (2) <simpletype>. second 1 separates (1) <complexcontent> , (2) <simplecontent>.

<xs:complexcontent> not seen, because implicit default whole structure can abbreviated omitting element. common structure

<xs:complextype>   ... (<xs:sequence> or anything) ... </xs:complextype> 

is identical to

<xs:complextype>   <xs:complexcontent>     <xs:restriction base="xs:anytype">       ... (<xs:sequence> or anything) ...     </xs:restriction>   </xs:complexcontent> </xs:complextype> 

in structure element type "availstatusmessagetype" 1) contains markup 2) , has child elements. structure complex type complex content. example seems correct though haven't used <xs:complexcontent> element, because using abbreviated form. identical this:

<xs:complextype name="availstatusmessagetype">     <xs:complexcontent>         <xs:restriction base="xs:anytype">             <xs:sequence>                 <xs:element name="lengthsofstay" type="lengthsofstaytype" />                 <xs:element name="restrictionstatus" type="restrictionstatustype"/>             </xs:sequence>             <xs:attribute name="bookinglimit">                 <xs:simpletype>                     <xs:restriction base="xs:string">                         <xs:enumeration value="setlimit" />                         <xs:enumeration value="adjustlimit"/>                         <xs:enumeration value="removelimit"/>                     </xs:restriction>                 </xs:simpletype>             </xs:attribute>         </xs:restriction>     </xs:complexcontent> </xs:complextype> 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -