I have declared the following type in my schema.

  <xs:simpleType name="_outlet">
    <xs:restriction base="xs:positiveInteger">
      <xs:pattern value="[0-9]{3}"/>
    </xs:restriction>
  </xs:simpleType>

The generator creates a set/get method which uses an "int" as the datatype.
The problem I'm facing is that pattern should allow "001" as valid value.
However when I use the set method with "001" validation fails because it
expect the int value to be 3 digits not 1, due 001 being converted back to
1. The same is true if I unmarshall xml containing <outlet>001</outlet>, it
generates an error because it does not match the pattern [0-9]{3}, however
this works fine in Xerces with schema validation.
Is there anyway to fix this without changing the datatype in the schema to
xs:string?

TIA

Jasbir






==================================================

HFC Bank Disclaimer

The information in this Email belongs to HFC Bank plc. It is intended for the use of 
the individual or entity to which it is addressed and may contain information that is 
privileged, confidential and exempt from disclosure under applicable law. If you are 
not the intended recipient, you are hereby notified that any disclosure, copying, 
distribution or the taking of any action in reliance on the contents of this Email is 
prohibited. If you have received this Email in error, please notify us immediately by 
telephone on 01344 890000 and delete the Email from your system and destroy all copies 
which you have made of the same.  Thank you. 

HFC Bank plc Company Registration Number - 1117305 England 
Registered Office: North Street, Winkfield Berkshire SL4 4TD.

Reply via email to