Andy B wrote:
Quote:
Quote:
>Sounds fine to me, you might additionally restrict zip code to five
>digits, enumerate the possible state codes.
|
>
I forgot about the fact that I had ZipCode set to require 5 characters. I
want to make this a 5 digit number but cant find a length property for the
int or integer data type. How would I fix this? I have it set to ZipCode
(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>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/