<?xml version='1.0'?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200010//EN" "XMLSchema.dtd" [
<!-- keep this XML 1.0 correct -->
<!ATTLIST schema xmlns:hfp CDATA #IMPLIED
                 xmlns:xhtml CDATA #IMPLIED>
<!ELEMENT xhtml:p ANY>
<!ELEMENT xhtml:emph ANY>
]>
<schema xmlns="http://www.w3.org/2000/10/XMLSchema" targetNamespace="http://www.w3.org/2000/10/XMLSchema-hasFacetAndProperty" xmlns:hfp="http://www.w3.org/2000/10/XMLSchema-hasFacetAndProperty" xmlns:xhtml="http://www.w3.org/1999/xhtml">

 <annotation>
  <documentation>
   <xhtml:p> This schema defines 2 elements for use in the
appinfo portion section of (potentially) all builtin datatypes in the schema
for XML Schema Part 2: Datatypes.  </xhtml:p>
   <xhtml:p> One intended use of
this appinfo is in the generation of the HTML version of the XML Schema Part 2:
Datatypes specification itself.  All portions of the HTML text which describe
the facets and/or properties of each datatype is generated by an XSLT
transformation which keys off of this appinfo.  </xhtml:p>
   <xhtml:p> Schema
processors may have another use for this appinfo (although one certainly not
required in any way by the specification).  The information may be useful in
dynamically building validation modules/classes and/or user-interfaces for
schema creation.  </xhtml:p>
  </documentation>
 </annotation>

 <element name="hasFacet">
  <annotation>
   <documentation>
    <xhtml:p> hasFacet is used to signal that the contraining
facet given in the name attribute is applicable to a primitive datatype (and
all types derived from it).  </xhtml:p>
    <xhtml:p> Note: this element will only
appear in the appinfo of primitive types or built-in types derived by "list".
</xhtml:p>
    <xhtml:p> A schema processor (or the XSLT which generates the HTML
version of the XML Schema Part 2: Datatypes specification) which reads a
derived simpleType definition should walk up the base type chain until it
reaches the primitive type at the top of the chain and "push" all facets found
their down to all derived types in the chain.  </xhtml:p>
   </documentation>
  </annotation>
  <complexType>
   <attribute name="name" use="required">
    <simpleType>
     <annotation>
      <documentation>
       <xhtml:p> This datatype names all existing contraining
facets.  </xhtml:p>
       <xhtml:p> Question: should each of the enumerations below
be given a documentation annotation, which would contain the text to be used in
the definition of the facet in the XML Schema Part 2: Datatypes specification?
Might be nice to try to collect all of that information together here.
</xhtml:p>
      </documentation>
     </annotation>
     <restriction base="NMTOKEN">
      <enumeration value="length"/>
      <enumeration value="minLength"/>
      <enumeration value="maxLength"/>
      <enumeration value="pattern"/>
      <enumeration value="enumeration"/>
      <enumeration value="maxInclusive"/>
      <enumeration value="maxExclusive"/>
      <enumeration value="minInclusive"/>
      <enumeration value="minExclusive"/>
      <enumeration value="precision"/>
      <enumeration value="scale"/>
      <enumeration value="encoding"/>
      <enumeration value="duration"/>
      <enumeration value="period"/>
     </restriction>
    </simpleType>
   </attribute>
  </complexType>
 </element>

 <element name="hasProperty">
  <annotation>
   <documentation>
    <xhtml:p> hasProperty is used to signal that the property
given in the name attribute has the value given in the value attribute for the
datatype in which it occurs (and all types derived from it, which do not
override the value of the property).  </xhtml:p>
    <xhtml:p> Note: this element
may appear in the appinfo of primitive and built-in derived types.  </xhtml:p>
    <xhtml:p> A schema processor (or the XSLT which generates the HTML version of
the XML Schema Part 2: Datatypes specification) which reads a simpleType
definition should gather the information from any occurances of hasProperty in
that simpleType definition, and then walk up the base type chain gathering
information from any occurances of hasProperty (unless a value was given to the
name in a dervied type) until either it reaches the primitive type at the top
of the chain or it has gathered values for all existing properties.  </xhtml:p>
   </documentation>
  </annotation>
  <complexType>
   <attribute name="name" use="required">
    <simpleType>
     <annotation>
      <documentation>
       <xhtml:p> This datatype names all existing fundamental
facets, otherwise known as properties (with the exception of
<xhtml:emph>equality</xhtml:emph>, a property which has no
<xhtml:emph>value</xhtml:emph>).  </xhtml:p>
       <xhtml:p> Question: should each of
the enumerations below be given a documentation annotation, which would contain
the text to be used in the definition of the properties in the XML Schema Part
2: Datatypes specification? Might be nice to try to collect all of that
information together here.  </xhtml:p>
      </documentation>
     </annotation>
     <restriction base="NMTOKEN">
      <enumeration value="ordered"/>
      <enumeration value="bounded"/>
      <enumeration value="cardinality"/>
      <enumeration value="numeric"/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name="value" type="string" use="required"/>
  </complexType>
 </element>
</schema>
