| WWW INFOMATION | |||||||||||||
| XML top >>XML Schema ■SimpleType
 シンプルタイプは、組み込みデータ型を自分で定義するようなイメージです。要素や属性に関係なく単純に型を定義します。 例えば、 
<?xml version="1.0"  ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/xmlSchema"> <xsd:element name="sample" type="myInteger" > <!-- データ型myIntegerを定義 --> <xsd:simpleType name="myInteger"> <!-- 整数値10000〜99999まで --> <xsd:restriction base="xsd:integer"> <xsd:minInclusive value="10000"/> <xsd:maxInclusive value="99999"/> </xsd:restriction> </xsd:simpleType> </xsd:schema> は、自分で"myInteger"というSimpleType型を定義し、それを要素sampleの型として使用しています。これにより要素sampleは、10000から99999までの整数でなくてはいけません。 シンプルタイプの内容は、"restriction "、"list"、"union"の3種類あります。 
 |  | ||||||||||||