xml要素にグローバル一意識別子(GUID)を使用しています。スキーマは次のようになります。
<xs:simpleType name="guidType">
<xs:restriction base="xs:string">
<xs:pattern value="[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]
{4}-[a-fA-F0-9]{12}"/>
</xs:restriction>
</xs:simpleType>
および次のようなxml要素:
<point guid="5C815FB2-0731-4E88-9885-CFC49B8E7B92" id="ABC" x="12" y="51" z="0"/>
対応するxsdスキーマ:
<xs:complexType name="pointType">
<xs:attribute name="guid" type="guidType" use="required"/>
<xs:attribute name="id" type="xs:token" use="required"/>
<xs:attribute name="x" type="xs:double" use="required"/>
<xs:attribute name="y" type="xs:double" use="required"/>
<xs:attribute name="z" type="xs:double" use="required"/>
</xs:complexType>
別の要素でポイント要素を参照したいと思います。例:
<layer>
<pointref guidref="5C815FB2-0731-4E88-9885-CFC49B8E7B92"/>
<pointref guidref="4671EFD4-506F-4A61-BCF0-427875074115"/>
</layer>
IDおよびIDREFタイプを使用して、スキーマファイルのポイントタイプ定義を変更することで、これを実現できます。
<xs:attribute name="guid" type="xs:ID" use="required"/>
質問:
xs:IDタイプをGUIDタイプにする方法はありますか?