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:any processContents="lax" minOccurs="0" maxOccurs="0"/>
      <xs:attribute ref="x:lang" use="optional"/>

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

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

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 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:58 UTC