xs:choice-1つだけ出現させる指定の記述例
XML Schema文書の例
<?xml version="1.0" encoding="Shift_JIS" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- 要素宣言 --> <xs:element name="x" type="xType"/> <!-- 複合型定義 --> <xs:complexType name="xType"> <xs:choice> <xs:element name="a" type="xs:string" /> <xs:element name="b" type="xs:string" /> </xs:choice> </xs:complexType> </xs:schema>
妥当なXML文書の例
<x> <a/> </x>
<x> <b/> </x>
妥当でないXML文書の例
<x> <a/> <b/> </x>
<x/>
page revision: 2, last edited: 19 May 2008 14:29