If I declare the xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://microsoft.com/wsdl/types/" >
<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="xs:string">
<xs:pattern value="([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|(\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\})"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
Then I can use this in other xsds like:
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:types="http://microsoft.com/wsdl/types/">
<xs:import namespace="http://microsoft.com/wsdl/types/" />
<!-- and at some point later -->
<xs:attribute name="Id" type="types:guid" use="required" />
And when I run it all through xsd.exe I will end up with a property:
System.Guid Id { get; set;}
Which is great, but what I would dearly like to know is how does xsd.exe know to associate my type definition with System.Guid?
In fact what I really want to know is: is there some way of getting it to know about other types? Like is there a way to associate a string with System.Version, or two ints with System.Windows.Point?
(or is this just a special case feature that someone at Microsoft worked into the tool off the books?)