Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Re-using a simple type definition; with enumeration constraint and without enumeration constraint [Thread Next] Re: Re-using a simple type definition; with enumeration constraint and without enumeration constraintTo: NULL Date: 2/1/2008 7:46:00 AM On Feb 1, 3:09=A0am, Pavel Lepin <p.le...@ctncorp.com> wrote: > Please don't top-post. Fixed. > > puvit82 <puvis...@gmail.com> wrote in > <5ec7e626-5e39-495a-96dc-4f76405b9...@q21g2000hsa.googlegroups.com>: > > > > > > > On Jan 31, 2:35=A0am, Pavel Lepin <p.le...@ctncorp.com> > > wrote: > >> puvit82 <puvis...@gmail.com> wrote: > >> > Lets suppose that I have defined a simpleType > >> > "addressType" with 3 enumeration values (Home, Office, > >> > Vacation) that restrict data entry. I want to use this > >> > simpleType in 2 different unrelated complexType > >> > definitions, lets call them "personalAddress" and > >> > "companyAddress" > > >> > How will I be able to use "addressType" inside > >> > "personalAddress" such that the 3 enumeration values > >> > are taken into consideration, i.e. data entry is > >> > restricted to either one of those three enumeration > >> > values and also use the same "addressType" inside > >> > "companyAddress" such that the enumeration values are > >> > not considered and the user can enter a completely > >> > different value for addressType (such as "HomeOffice" > >> > and the schema validates the XML file)? > > >> It's in no way the "same simple type" if in one case it's > >> an enumeration, and in the other case it isn't. Why do > >> you want to use the same type name to designate two > >> vastly different things? To introduce some unnecessary > >> confusion? > > > pavel, i want to be able to use the same schema type > > because the schema is set and has been communicated to the > > recipients; making a change now will cause them to have to > > update their schema and their mapping code (which is > > something i want to avoid) > > You're missing the point. The types are different. You > cannot refer to two different types by just one name. > Either define two types, or use one unconstrained type and > check constraints on the application side. > > -- > <>There is no phenotype</>- Hide quoted text - > > - Show quoted text - Pavel, Thanks for the responses! .. I'm going to go ahead and create two different types. Puvit | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
