XML
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by skm (skm) -->
<MOVIEDETAILS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="D:\Programming\XML\UGP2\1\movie.xsd">
<MOVIE>
<MOVID>M007</MOVID>
<MOVCAT>HORROR</MOVCAT>
<DOR>2003-12-12</DOR>
<NAME>Evil Dead</NAME>
<CAST>Sylvia</CAST>
<DIRECTOR>Suresh</DIRECTOR>
<AWARDS>Horror Award</AWARDS>
</MOVIE>
</MOVIEDETAILS>
XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="MOVIEDETAILS" type="MD"/>
<xs:complexType name="MD">
<xs:sequence>
<xs:element name="MOVIE" type="MOV"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="MOV">
<xs:sequence>
<xs:element name="MOVID" type="MOID"/>
<xs:element name="MOVCAT" type="MCT"/>
<xs:element name="DOR" type="DT"/>
<xs:element name="NAME" type="xs:string"/>
<xs:element name="CAST" type="xs:string"/>
<xs:element name="DIRECTOR" type="xs:string"/>
<xs:element name="AWARDS" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="MOID">
<xs:restriction base="xs:string">
<xs:length value="4"/>
<xs:pattern value="[M]\d{3}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="MCT">
<xs:restriction base="xs:string">
<xs:pattern value="(HORROR{1}|ROMANCE{1}|COMEDY{1} |DRAMA{1}|ACTION{1} )"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="DT">
<xs:restriction base="xs:string">
<xs:pattern value="\d{4}-\d{2}-\d{2}"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
|