Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] What happens if facets contradict each others?

From: "Michael Kay" <mike@--------.--->
To: <khoyee@---.------.--.-->,<xml-dev@-----.---.--->
Date: 10/5/2007 8:34:00 AM
> Let me make my points clearer through an example. Let's say 
> the XML schema defines a new datatype as such:
> 
> <simpleType name="myDecimal">
>        <restriction base="decimal">
>                <maxInclusive value="0.0"></maxInclusive>
>                <enumeration value="1.0"></enumeration>
>                <enumeration value="2.0"></enumeration>
>                <enumeration value="3.0"></enumeration>
>        </restriction>
> </simpleType>
> 
> I checked this against Validome's XML Schema Validator
> (http://www.validome.org/grammar/) but it said the schema is 
> valid, although all enumeration values contradict the value 
> defined in maxInclusive.

The schema is indeed valid, but it defines a type that has no valid
instances, so an instance generator should refuse to generate any instances
of this type.

There are many other types you can define that have no valid instances, for
example a restriction of decimal with a pattern of "[A-Z]".

Michael Kay
http://www.saxonica.com/


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