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

Is there or is there not an xs:anySimpleType ?

From: Hugh Wallis <hugh_wallis@hyperion.com>
Date: Sun, 23 Feb 2003 17:32:08 -0500
Message-ID: <039b01c2db8b$667620f0$b8941bac@hyperion.com>
To: <xmlschema-dev@w3.org>
I have been trying to figure out whether Microsoft's .NET parser is correct or not when it objects to the use of type="anySimpleType" and the deeper I get into it the more confused I get. The message I get from the .NET parser if I use type="anySimpleType" is: 

        Type 'http://www.w3.org/2001/XMLSchema:anySimpleType' is not declared. 

Even the normative schema for schemas (http://www.w3.org/TR/xmlschema-2/#schema) doesn't really resolve it for me.

In the documentation for the schema for schemas (which it admittedly says is non-normative) it says:

      First the built-in primitive datatypes.  These definitions are for
      information only, the real built-in definitions are magic.  Note in
      particular that there is no type named 'anySimpleType'.  The
      primitives should really be derived from no type at all, and
      anySimpleType should be derived as a union of all the primitives.

and, indeed, there is no declaration for anySimpleType which would imply that .NET has got it right and yet the actual primitive data types are derived by restriction from xs:anySimpleType in examples such as:

  <xs:simpleType name="string" id="string">
    <xs:annotation>
      <xs:appinfo>
        <hfp:hasFacet name="length"/>
        <hfp:hasFacet name="minLength"/>
        <hfp:hasFacet name="maxLength"/>
        <hfp:hasFacet name="pattern"/>
        <hfp:hasFacet name="enumeration"/>
        <hfp:hasFacet name="whiteSpace"/>
        <hfp:hasProperty name="ordered" value="false"/>
        <hfp:hasProperty name="bounded" value="false"/>
        <hfp:hasProperty name="cardinality" value="countably infinite"/>
        <hfp:hasProperty name="numeric" value="false"/>
      </xs:appinfo>
      <xs:documentation
                source="http://www.w3.org/TR/xmlschema-2/#string"/>
    </xs:annotation>
    <xs:restriction base="xs:anySimpleType">
      <xs:whiteSpace value="preserve" id="string.preserve"/>
    </xs:restriction>
  </xs:simpleType>

Can anyone explain this apparent discrepancy for me?  

Many thanks

Hugh Wallis
Received on Sunday, 23 February 2003 17:32:47 GMT

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