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\UGP1\3\movie.xsd">
<MOVIE>
<TITLE>The Sixth Sense</TITLE>
<MOVIEID>M876</MOVIEID>
<DIRNAME>M Night Shyamalan</DIRNAME>
<CAST>Bruce Wills, Haley Joel Osment</CAST>
<YEAROFRELEASE>1999</YEAROFRELEASE>
</MOVIE>
</MOVIEDETAILS>
XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="MOVIEDETAILS" type="mdetail"/>
<xs:complexType name="mdetail">
<xs:sequence>
<xs:element name="MOVIE" type="mdtl"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="mdtl">
<xs:sequence>
<xs:element name="TITLE" type="xs:string"/>
<xs:element name="MOVIEID" type="mid"/>
<xs:element name="DIRNAME" type="xs:string"/>
<xs:element name="CAST" type="xs:string"/>
<xs:element name="YEAROFRELEASE" type="xs:positiveInteger"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="mid">
<xs:restriction base="xs:string">
<xs:length value="4"/>
<xs:pattern value="[M]\d{3}"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
|