W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2002

Shouldn't this restriction be invalid?

From: Steven Bird <sb@unagi.cis.upenn.edu>
Date: Mon, 30 Sep 2002 07:31:19 -0400 (EDT)
Message-Id: <200209301131.g8UBVGL26807@unagi.cis.upenn.edu>
To: xmlschema-dev@w3.org
Cc: Gary Simons <Gary_Simons@sil.org>





I'm trying to understand what is going on with the following restriction,
which originates in [http://www.ukoln.ac.uk/metadata/dcmi/xmlschema/].
This is valid according to XSV, and invalid according to XML Spy.

>From the documentation, "The SimpleLiteral complexType is defined in
terms of mixed complexContent. However, the cardinality attributes on
the xs:any element dictate that this complexType does not permit child
elements."  Here's the definition of SimpleLiteral:

<xs:complexType name="SimpleLiteral">
  <xs:complexContent mixed="true">
    <xs:restriction base="xs:anyType">
      <xs:sequence>
        <xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
      </xs:sequence>
      <xs:attribute ref="x:lang" use="optional"/>
    </xs:restriction>
  </xs:complexContent>
</xs:complexType>

The following type, W3CDTF, is defined as a restriction of SimpleLiteral.
Note that it specifies simpleContent instead of complexContent.

<xs:complexType name="W3CDTF">
  <xs:simpleContent>
    <xs:restriction base="SimpleLiteral">
      <xs:simpleType>
        <xs:union memberTypes="xs:gYear xs:gYearMonth xs:date xs:dateTime"/>
      </xs:simpleType>
      <xs:attribute ref="x:lang" use="prohibited"/>
    </xs:restriction>
  </xs:simpleContent>
</xs:complexType>

Is this a legal derived type?  Why don't the validators agree?
Thanks for any explanations or advice.

Steven Bird

--
Steven Bird        Email: <sb@cs.mu.oz.au>  Web: http://www.cs.mu.oz.au/~sb/
A/Prof, Dept of Computer Science, University of Melbourne, Vic 3010, AUSTRALIA
Senior Research Assoc, Linguistic Data Consortium, University of Pennsylvania
Received on Wednesday, 2 October 2002 15:44:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT