ws-jaxme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Eric Reeves <rob...@phurnace.com>
Subject Re: Question about pattern/enumeration constraint from Sheng
Date Fri, 29 Dec 2006 17:14:02 GMT
Yep, I've got enumeration working throughout my XSD. Maybe there is 
another bug with the datatype "positiveInteger". I use "xsd:string" for 
all my enumerations. (Not by choice, it's just that they just so happen 
to be strings.)

It sounds like you're doing some pretty good testing of  JaxMe to make 
sure it works for your needs. I'm sure Jochen will check it out and get 
back to you to give you a final answer.

Robert

Huang, Sheng (FSH) wrote:
> 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:robert@phurnace.com] 
> 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: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Mime
View raw message