XML
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by skm (skm) -->
<RESERVATION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="D:\Programming\XML\UGP1\4\reserv.xsd">
<FROM>NY</FROM>
<TO>Chicago</TO>
<FARE>54635</FARE>
<DATE>2001-12-12</DATE>
<CLASS>Economy</CLASS>
</RESERVATION>
XSD
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<xsd:element name="RESERVATION" type="res" />
<xsd:complexType name ="res" >
<xsd:sequence>
<xsd:element name="FROM" type="fromdef" />
<xsd:element name="TO" type="fromdef" />
<xsd:element name="FARE" type="xsd:positiveInteger" />
<xsd:element name="DATE" type="dt" />
<xsd:element name="CLASS" type="classdef" />
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="fromdef" >
<xsd:restriction base="xsd:string" >
<xsd:pattern value="(NY{1}|Chicago{1}|Miami{1}|Pittsburgh{1})"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="classdef" >
<xsd:restriction base="xsd:string" >
<xsd:pattern value="(First{1}|Executive{1}|Economy{1})" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="dt" >
<xsd:restriction base="xsd:string" >
<xsd:pattern value="\d{4}-\d{2}-\d{2}"/>
</xsd:restriction>
</xsd:simpleType>
|