>> Sounds fine to me, you might additionally restrict zip code to five
>> digits, enumerate the possible state codes.
[quoted text clipped - 4 lines]
> (string) - length=5. You also said to make an enum for the state codes. How
> exactly do I do this?
Straight from <URL:http://www.w3.org/TR/xmlschema-0/> is this example:
<xsd:simpleType name="USState">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="AK"/>
<xsd:enumeration value="AL"/>
<xsd:enumeration value="AR"/>
<!-- and so on ... -->
</xsd:restriction>
</xsd:simpleType>
As for the zip code, one way is with a regular expression pattern:
<xsd:simpleType name="zipType">
<xsd:restriction base="xsd:positiveInteger">
<xsd:pattern value="\d{5}"/>
</xsd:restriction>
</xsl:simpleType>

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Andy B - 27 Mar 2008 18:55 GMT
Why would it be a good idea to do an enum for the state codes instead of
just letting somebody typing it in just a string field?
>>> Sounds fine to me, you might additionally restrict zip code to five
>>> digits, enumerate the possible state codes.
[quoted text clipped - 22 lines]
> </xsd:restriction>
> </xsl:simpleType>
Martin Honnen - 27 Mar 2008 19:05 GMT
> Why would it be a good idea to do an enum for the state codes instead of
> just letting somebody typing it in just a string field?
In terms of the W3C schema language I suggested an _enumeration_ below:
>> <xsd:simpleType name="USState">
>> <xsd:restriction base="xsd:string">
[quoted text clipped - 4 lines]
>> </xsd:restriction>
>> </xsd:simpleType>
Or are you now talking about a .NET enumeration defined with C# or VB.NET?

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Andy B - 27 Mar 2008 19:46 GMT
You have the right thing. Does it do the same thing a c# enum would do?
either restrict the strings that can be used, or make useful names for
meaningless numbers (like a c# enum does)?
>> Why would it be a good idea to do an enum for the state codes instead of
>> just letting somebody typing it in just a string field?
[quoted text clipped - 11 lines]
>
> Or are you now talking about a .NET enumeration defined with C# or VB.NET?
Martin Honnen - 28 Mar 2008 12:57 GMT
> You have the right thing. Does it do the same thing a c# enum would do?
> either restrict the strings that can be used, or make useful names for
> meaningless numbers (like a c# enum does)?
The simple type I posted is a restriction of xsd:string allowing only
the enumerated string values (e.g. "AK" or "AL") to be used.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Andy B - 28 Mar 2008 18:53 GMT
Makes sense to me. I added all of the state codes to the schema.
>> You have the right thing. Does it do the same thing a c# enum would do?
>> either restrict the strings that can be used, or make useful names for
>> meaningless numbers (like a c# enum does)?
>
> The simple type I posted is a restriction of xsd:string allowing only the
> enumerated string values (e.g. "AK" or "AL") to be used.