<!rules for creating market using xml schema>
<xs:schema smlns:xs="http://www.w3.org/2001/xmlschema">
<xs:element name="market">
<xs:complexType>
<xs:sequence>
<xs:element name="product" minOccurs="1" MaxOccurs="10">
<xs:complexType>
<xs:all>
<xs:element name="pid">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z][0-9a-zA-Z]"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:element name="pname">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="([0-9])+"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="desc" type="xs:string"/>
</xs:all>
<xs:attribute name="quantity" type="xs:integer" use="required">
<xs:attribute name="type" type="xs.string" use="optional" default="retail">
<xs:attribute name="barcode" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Schema for Rules for creating Student document
<xs:schema smlns:xs="http://www.w3.org/2001/xmlschema">
<xs:element name="market">
<xs:complexType>
<xs:sequence>
<xs:element name="product" minOccurs="1" MaxOccurs="10">
<xs:complexType>
<xs:all>
<xs:element name="pid">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z][0-9a-zA-Z]"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:element name="pname">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="([0-9])+"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="desc" type="xs:string"/>
</xs:all>
<xs:attribute name="quantity" type="xs:integer" use="required">
<xs:attribute name="type" type="xs.string" use="optional" default="retail">
<xs:attribute name="barcode" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Schema for Rules for creating Student document
No comments:
Post a Comment