Thursday, 17 January 2008

Useful simple type for Global Unique Identifier

Keep having to use this in schemas - so thought I would put this here..

This type will verify a global unqiue identifier:

<xs:simpleType name="GUID">
<xs:annotation>
<xs:documentation xml:lang="en">The representation of a GUID, generally the id of an element.</xs:documentation>
</xs:annotation>
<xs:restriction base="xsd: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>

No comments: