Good morning Rob, Thanks a lot for your help. Actually I tried enumeration exactly as your code sample before, however it is also not working.
I tried address.xsd under \ws-jaxme-0.5.2\examples\xs\primer\, it works in the same way (no code is created for validating USState or UKPostcode in that example). Have you ever got enumeration working? Or something else I might be missing? Best regards, Sheng -----Original Message----- From: Robert Eric Reeves [mailto:[EMAIL PROTECTED] Sent: Friday, December 29, 2006 10:56 AM To: Huang, Sheng (FSH) Cc: jaxme-dev@ws.apache.org Subject: Re: Question about pattern/enumeration constraint from Sheng That does look like a bug to me. A work around until it's fixed might be to use enumeration. In fact, I would recommend that because it's easier to read -- at least for me... <xsd:simpleType name="StatusType"> <xsd:restriction base="xsd:positiveInteger"> <xsd:enumeration value="5"/> <xsd:enumeration value="8"/> </xsd:restriction> </xsd:simpleType> Huang, Sheng (FSH) wrote: > > Good morning, > > > > I am trying JAXME 0.5.2 and I can run some examples as well as create > some simple programs. > > > > However, I have problem with creating a constraint to only allow > integer 5 and 8 as the status. It seems that pattern and enumeration > are not working. > > <xsd:simpleType name="StatusType"> > > <xsd:restriction base="xsd:positiveInteger"> > > <xsd:pattern value="5|8"/> > > </xsd:restriction> > > </xsd:simpleType> > > > > In generated Impl class, I cannot find code to check whether status is > 5 or 8, and throw exception otherwise. I run the program and no error > is thrown for other values. But constraint like > > <xsd:restriction base="xsd:string"> > > <xsd:maxLength value="50" /> > > </xsd:restriction> > > work well and I can find the code in corresponding Impl class to check > length. > > > > Would you please give me a hint about what I am wrong or whether those > features are supported? Thank you very much for your help. > > > > Have a good day. > > > > Best regards, > > Sheng > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]