Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Restriction based on attribute value

From: Xan Gregg <xan.gregg@---.--->
To: <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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent