Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Restriction based on attribute value [Thread Next] Re: Restriction based on attribute valueTo: <richard.liu@---.---> Date: 5/3/2004 6:28:00 AM There's no general way for the value of an attribute to constrain the element content in XML Schema, except for one special attribute, "xsi:type". I think you can achieve the effect you are looking for with xsi:type by making separate type definitions for the various cases like "viewing-800". If xsi:type seems too unnatural for your application, you might try a tool called schematron, which allows you to specify additional schema constraints in a separate document. xan On May 3, 2004, at 6:58 AM, <richard.liu@u...> wrote: > My schema defines an element images consisting of child elements > image. Each image has an attribute context, an enumeration of > "viewing", "viewing-1024", "viewing-800", "printing". I would like to > define a new type of images based on images. The new type must have > at least two image child elements, one with context="viewing-1024" and > one with context="viewing-800". How can I do this, perhaps by > restricting the original images? > > Thanks, > Richard R. Liu From rschloss@u... Mon May 3 13:49:19 2004 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
