Attributes Entitites   «Prev 

Creating XML Schemas

1) An XML schema declaration begins with the schema element that specifies a URI for a namespace.
An XML schema declaration begins with the schema element that specifies a URI for a namespace. The de facto prefix for XML schemas is xsd.

2) The first statement declares an element named Order.
The first statement declares an element named Order. Its element type is OrderType. The second statement declares an element named comment. The comment element type is string. Note that string is prefixed with xsd, the de facto namespace prefix for XML schemas.

3) The next group of statements defines the OrderType declared previously.
The next group of statements defines the OrderType declared previously. Order type consists of several elements, which must be present in the sequence specified by the <xsd:sequence> element. The <xsd:element ref="comment" minOccurs="0" /> indicates that this element is a reference to the comment element.

4) This group of statements defines a simple type named SKU
This group of statements defines a simple type named SKU. Using the <xsd:restriction base="string"> element this simple type is restricted to type string. In addition, this string simple type must follow a pattern as indicated by the
<xsd:pattern value="\d[3]-[A-Z][2] "/> .