W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2003

xs:integer restricted to be empty should be invalid (XSV and Xerces result)

From: Stanley Guan <stanley.guan@oracle.com>
Date: Mon, 17 Mar 2003 10:21:50 -0800
Message-ID: <080301c2ecb2$14e60d30$c5b42382@us.oracle.com>
To: <xmlschema-dev@w3.org>
Cc: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>

In the following schema document (i.e., mytest.xsd), base2 should not be
a valid restriction of base1 because base2's content is empty while empty
string is NOT valid with "xs:integer".

With my prelimary testing, both XSV and Xerces think mytest.xsd is valid.
For example, with the given instance document (i.e.,  mytest.xml).  Xerces
was happy.  But, if I changed subelement "alternate1" to "head", it failed
   Element 'head' must have no element [children], and the value must be
because empty string is not valid with "xs:integer" type which is
to the fact that Xerces thought mytest.xsd was valid.




<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
    <xs:element name="head" type="base1"/>
    <xs:element name="alternate1" type="base2" substitutionGroup="head"
                block="substitution" />
    <xs:element name="root">
                <xs:element ref="head" minOccurs="1" maxOccurs="1"/>

    <xs:complexType name="base1" >
            <xs:extension base="xs:integer">

    <xs:complexType name="base2">
            <xs:restriction base="base1">



Received on Monday, 17 March 2003 13:24:06 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:00 UTC