IDNumberType is defined by restriction from integer, so it can’t be compared with a string.
Deriving IDNumberType from integer is probably not a good idea, since leading zeros appear to be significant. In fact, using a pattern facet in the type definition of an integer is not going to work well. If you try to output an IDNumberType, this will involve a string to integer conversion, and the conversion will always produce an integer with no leading zeros, which then fails validation against the pattern. If the leading zeros really are significant, then I think you should derive IDNumberType from string, not from integer.
What it comes down to is that 001 and 1 are two different representations of the same integer. If you want to treat these two values differently, for validation or comparison or anything else, then they are not really integers, and shouldn’t be described as such.
Michael Kay
#Tamino#API-Management#webMethods