I can give an example,

How do I do either of these with annotations:


  <!-- Custom restriction for name -->
  <xs:simpleType name="name">
    <xs:restriction base="xs:string">
      <xs:pattern value="[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]*" />
    </xs:restriction>
  </xs:simpleType>

OR a key

  <!-- Custom key for address name in user -->
  <xs:element name="user" type="user">
    <xs:key name="nameKey">
      <xs:selector xpath="addresses/address" />
      <xs:field xpath="name" />
    </xs:key>
  </xs:element>


-----Original Message-----
From: KARR, DAVID (ATTSI) [mailto:[email protected]] 
Sent: Tuesday, March 01, 2011 3:49 PM
To: [email protected]
Subject: RE: JAXB: Any way to incorporate restrictions into annotations?

> -----Original Message-----
> From: jbradfor [mailto:[email protected]]
> Sent: Tuesday, March 01, 2011 3:46 PM
> To: [email protected]
> Subject: Re: JAXB: Any way to incorporate restrictions into
> annotations?
> 
> We use SimpleTypes, range restrictions (which will not gen but will
> validate,
> if requested), and Enums for name/value pairs.

Could you please elaborate, for instance range restrictions?

Reply via email to