Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redefine xml schema

Status
Not open for further replies.

edwong

Programmer
Mar 26, 2003
30
US
Hi all,

I have a xsd file (which I am not allow to change) that contains a complexType called 'AddressType'. Inside this type, there is an element called 'PostalCode' of type xs:string.

Now, I need to do data validation (e.g. ensure it is 5 digits) on 'PostalCode' in another xsd file. Anyone know who to do this? Since I couldn't get the extension/restriction to work.

Thank you

Edmund
 
Code:
<xs:element name="PostalCode">
  <xs:simpleType>
    <xs:restriction base="xs:integer">
      <xs:pattern value="[0-9][0-9][0-9][0-9][0-9]"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top