shema实例:
<?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/03" xmlns:tns="http://www.example.org/03" elementFormDefault="qualified"> <element name="person" type="tns:personType"/> <complexType name="personType"> <sequence> <element name="name" type="string"/> <element name="age" type="tns:ageType"/> <element name="email" type="tns:emailType"/> </sequence> <attribute name="sex" type="tns:sexType"/> </complexType> <simpleType name="sexType"> <restriction base="string"> <enumeration value="男"/> <enumeration value="女"/> </restriction> </simpleType> <simpleType name="ageType"> <restriction base="int"> <minInclusive value="1"/><!-- 最小值包括1 --> <maxExclusive value="150"/><!-- 最大值不包括150 --> </restriction> </simpleType> <simpleType name="emailType"> <restriction base="string"> <pattern value="(\w+\.*)*\w+@\w+\.\w+"/><!-- 格式形如:sdfsd.cxovd@12.com --> </restriction> </simpleType> </schema>