targetNamespace "http://www.w3.org/2001/XMLSchema" default block version "Id: XMLSchema.xsd,v 1.48 2001/04/24 18:56:39 ht Exp " /* The schema corresponding to this document is normative, with respect to the syntactic constraints it expresses in the XML Schema language. The documentation (within elements) below, is not normative, but rather highlights important aspects of the W3C Recommendation of which this is a part */ /* The simpleType element and all of its members are defined in datatypes.xsd */ include "datatypes.xsd" import "http://www.w3.org/2001/xml.xsd" namespace "http://www.w3.org/XML/1998/namespace" /* This type is extended by almost all schema types to allow attributes from other namespaces to be added to user schemas. */ complexType openAttrs restricts xs:anyType { anyAttribute namespace ##other } /* This type is extended by all types which allow annotation other than itself */ complexType annotated extends xs:openAttrs { ( xs:annotation?, ) attribute id { xs:ID } } /* This group is for the elements which occur freely at the top level of schemas. All of their types are based on the "annotated" type by extension. */ group schemaTop { ( @xs:redefinable | xs:element | xs:attribute | xs:notation ) } /* This group is for the elements which can self-redefine (see below). */ group redefinable { ( xs:simpleType | xs:complexType | xs:group | xs:attributeGroup ) } /* A utility type, not for public use */ simpleType formChoice { xs:NMTOKEN { "qualified", "unqualified" } } /* A utility type, not for public use */ simpleType reducedDerivationControl { xs:derivationControl { "extension", "restriction" } } /* A utility type, not for public use #all or (possibly empty) subset of {extension, restriction} */ simpleType derivationSet { union { xs:token { "#all" }; list { xs:reducedDerivationControl } } } element schema extends xs:openAttrs { ( ( xs:include | xs:import | xs:redefine | xs:annotation )*, ( @xs:schemaTop, xs:annotation* )* ) attribute \targetNamespace { xs:anyURI } attribute \version { xs:token } attribute finalDefault { xs:derivationSet } attribute blockDefault { xs:blockSet } attribute attributeFormDefault { xs:formChoice } <= "unqualified" attribute elementFormDefault { xs:formChoice } <= "unqualified" attribute id { xs:ID } attribute xml:lang key \element field "@name" in "xs:element" key \attribute field "@name" in "xs:attribute" key type field "@name" in "xs:complexType|xs:simpleType" key \group field "@name" in "xs:group" key \attributeGroup field "@name" in "xs:attributeGroup" key \notation field "@name" in "xs:notation" key identityConstraint field "@name" in ".//xs:key|.//xs:unique|.//xs:keyref" } /* for maxOccurs */ simpleType allNNI { union { xs:nonNegativeInteger; xs:NMTOKEN { "unbounded" } } } /* for all particles */ attributeGroup occurs { attribute minOccurs { xs:nonNegativeInteger } <= "1" attribute maxOccurs { xs:allNNI } <= "1" } /* for element, group and attributeGroup, which both define and reference */ attributeGroup defRef { attribute name { xs:NCName } attribute ref { xs:QName } } /* 'complexType' uses this */ group typeDefParticle { ( \group { xs:groupRef } | xs:all | xs:choice | xs:sequence ) } group nestedParticle { ( \element { xs:localElement } | \group { xs:groupRef } | xs:choice | xs:sequence | xs:any ) } group particle { ( \element { xs:localElement } | \group { xs:groupRef } | xs:all | xs:choice | xs:sequence | xs:any ) } complexType \attribute extends xs:annotated { ( \simpleType { xs:localSimpleType }?, ) attribute type { xs:QName } attribute use { xs:NMTOKEN { "prohibited", "optional", "required" } } <= "optional" attribute \default { xs:string } attribute \fixed { xs:string } attribute form { xs:formChoice } attributeGroup xs:defRef } complexType topLevelAttribute restricts xs:attribute { ( xs:annotation?, \simpleType { xs:localSimpleType }? ) prohibited attribute ref prohibited attribute form prohibited attribute use required attribute name { xs:NCName } } group attrDecls { ( ( \attribute { xs:attribute } | \attributeGroup { xs:attributeGroupRef } )*, xs:anyAttribute? ) } element \anyAttribute { xs:wildcard } group complexTypeModel { ( xs:simpleContent | xs:complexContent | ( @xs:typeDefParticle?, @xs:attrDecls ) ) } abstract complexType \complexType extends xs:annotated { @xs:complexTypeModel /* Will be restricted to required or forbidden */ attribute name { xs:NCName } /* Not allowed if simpleContent child is chosen. May be overriden by setting on complexContent child. */ attribute \mixed { xs:boolean } <= "false" attribute \abstract { xs:boolean } <= "false" attribute \final { xs:derivationSet } attribute \block { xs:derivationSet } } complexType topLevelComplexType restricts xs:complexType { ( xs:annotation?, @xs:complexTypeModel ) required attribute name { xs:NCName } } complexType localComplexType restricts xs:complexType { ( xs:annotation?, @xs:complexTypeModel ) prohibited attribute name prohibited attribute \abstract prohibited attribute \final prohibited attribute \block } complexType restrictionType extends xs:annotated { ( ( @xs:typeDefParticle? | @xs:simpleRestrictionModel? ), @xs:attrDecls ) required attribute base { xs:QName } } complexType complexRestrictionType restricts xs:restrictionType { ( xs:annotation?, @xs:typeDefParticle?, @xs:attrDecls ) } complexType extensionType extends xs:annotated { ( @xs:typeDefParticle?, @xs:attrDecls ) required attribute base { xs:QName } } element complexContent extends xs:annotated { ( restriction { xs:complexRestrictionType } | extension { xs:extensionType } ) /* Overrides any setting on complexType parent. */ attribute \mixed { xs:boolean } } complexType simpleRestrictionType restricts xs:restrictionType { ( xs:annotation?, @xs:simpleRestrictionModel?, @xs:attrDecls ) } complexType simpleExtensionType restricts xs:extensionType { ( xs:annotation?, @xs:attrDecls ) } element simpleContent extends xs:annotated { ( restriction { xs:simpleRestrictionType } | extension { xs:simpleExtensionType } ) } element \complexType { xs:topLevelComplexType } /* A utility type, not for public use #all or (possibly empty) subset of {substitution, extension, restriction} */ simpleType blockSet { union { xs:token { "#all" }; list { xs:derivationControl { "extension", "restriction", "substitution" } } } } /* The element element can be used either at the top level to define an element-type binding globally, or within a content model to either reference a globally-defined element or type or declare an element-type binding locally. The ref form is not allowed at the top level. */ abstract complexType \element extends xs:annotated { ( ( \simpleType { xs:localSimpleType } | \complexType { xs:localComplexType } )?, @xs:identityConstraint* ) attribute type { xs:QName } attribute substitutionGroup { xs:QName } attribute \default { xs:string } attribute \fixed { xs:string } attribute \nillable { xs:boolean } <= "false" attribute \abstract { xs:boolean } <= "false" attribute \final { xs:derivationSet } attribute \block { xs:blockSet } attribute form { xs:formChoice } attributeGroup xs:defRef attributeGroup xs:occurs } complexType topLevelElement restricts xs:element { ( xs:annotation?, ( \simpleType { xs:localSimpleType } | \complexType { xs:localComplexType } )?, @xs:identityConstraint* ) prohibited attribute ref prohibited attribute form prohibited attribute minOccurs prohibited attribute maxOccurs required attribute name { xs:NCName } } complexType localElement restricts xs:element { ( xs:annotation?, ( \simpleType { xs:localSimpleType } | \complexType { xs:localComplexType } )?, @xs:identityConstraint* ) prohibited attribute substitutionGroup prohibited attribute \final prohibited attribute \abstract } element \element { xs:topLevelElement } /* group type for explicit groups, named top-level groups and group references */ abstract complexType \group extends xs:annotated { @xs:particle* attributeGroup xs:defRef attributeGroup xs:occurs } complexType realGroup restricts xs:group { ( xs:annotation?, ( xs:all | xs:choice | xs:sequence )? ) } /* Should derive this from realGroup, but too complicated for now */ complexType namedGroup { ( xs:annotation?, ( all | choice { xs:simpleExplicitGroup } | sequence { xs:simpleExplicitGroup } ) ) element all restricts xs:all { @xs:allModel prohibited attribute minOccurs prohibited attribute maxOccurs } required attribute name { xs:NCName } prohibited attribute ref prohibited attribute minOccurs prohibited attribute maxOccurs } complexType groupRef restricts xs:realGroup { ( xs:annotation?, ) required attribute ref { xs:QName } prohibited attribute name } /* group type for the three kinds of group */ complexType explicitGroup restricts xs:group { ( xs:annotation?, @xs:nestedParticle* ) prohibited attribute name { xs:NCName } prohibited attribute ref { xs:QName } } complexType simpleExplicitGroup restricts xs:explicitGroup { ( xs:annotation?, @xs:nestedParticle* ) prohibited attribute minOccurs prohibited attribute maxOccurs } group allModel { ( xs:annotation?, \element* ) element \element restricts xs:localElement { ( xs:annotation?, ( \simpleType { xs:localSimpleType } | \complexType { xs:localComplexType } )?, @xs:identityConstraint* ) attribute minOccurs { xs:nonNegativeInteger { "0", "1" } } <= "1" attribute maxOccurs { xs:allNNI { "0", "1" } } <= "1" } } /* Only elements allowed inside */ complexType all restricts xs:explicitGroup { @xs:allModel attribute minOccurs { xs:nonNegativeInteger { "0", "1" } } <= "1" attribute maxOccurs { xs:allNNI { "1" } } <= "1" } element all { xs:all } element choice { xs:explicitGroup } element sequence { xs:explicitGroup } element \group { xs:namedGroup } complexType wildcard extends xs:annotated { attribute \namespace { xs:namespaceList } <= "##any" attribute processContents { xs:NMTOKEN { "skip", "lax", "strict" } } <= "strict" } element \any extends xs:wildcard { attributeGroup xs:occurs } /* simple type for the value of the 'namespace' attr of 'any' and 'anyAttribute' */ /* Value is ##any - - any non-conflicting WFXML/attribute at all ##other - - any non-conflicting WFXML/attribute from namespace other than targetNS ##local - - any unqualified non-conflicting WFXML/attribute one or - - any non-conflicting WFXML/attribute from more URI the listed namespaces references (space separated) ##targetNamespace or ##local may appear in the above list, to refer to the targetNamespace of the enclosing schema or an absent targetNamespace respectively */ /* A utility type, not for public use */ simpleType namespaceList { union { xs:token { "##any", "##other" }; list { union { xs:anyURI; xs:token { "##targetNamespace", "##local" } } } } } element \attribute { xs:topLevelAttribute } abstract complexType \attributeGroup extends xs:annotated { @xs:attrDecls attributeGroup xs:defRef } complexType namedAttributeGroup restricts xs:attributeGroup { ( xs:annotation?, @xs:attrDecls ) required attribute name { xs:NCName } prohibited attribute ref } complexType attributeGroupRef restricts xs:attributeGroup { ( xs:annotation?, ) required attribute ref { xs:QName } prohibited attribute name } element \attributeGroup { xs:namedAttributeGroup } element \include extends xs:annotated { required attribute schemaLocation { xs:anyURI } } element \redefine extends xs:openAttrs { ( xs:annotation | @xs:redefinable )* required attribute schemaLocation { xs:anyURI } attribute id { xs:ID } } element \import extends xs:annotated { attribute \namespace { xs:anyURI } attribute schemaLocation { xs:anyURI } } element selector extends xs:annotated { required attribute xpath { xs:token { /(\.\/\/)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(\/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.\/\/)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(\/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*/ } } } element \field extends xs:annotated { required attribute xpath { xs:token { /(\.\/\/)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)\/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.\/\/)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)\/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*/ } } } complexType keybase extends xs:annotated { ( xs:selector, xs:field+ ) required attribute name { xs:NCName } } /* The three kinds of identity constraints, all with type of or derived from 'keybase'. */ group identityConstraint { ( xs:unique | xs:key | xs:keyref ) } element \unique { xs:keybase } element \key { xs:keybase } element \keyref extends xs:keybase { required attribute refer { xs:QName } } element \notation extends xs:annotated { required attribute name { xs:NCName } required attribute \public { xs:public } attribute \system { xs:anyURI } } /* A utility type, not for public use A public identifier, per ISO 8879 */ simpleType \public { xs:token } element appinfo { mixed ( { any }, )* attribute source { xs:anyURI } } element documentation { mixed ( { any }, )* attribute source { xs:anyURI } attribute xml:lang } element annotation extends xs:openAttrs { ( xs:appinfo | xs:documentation )* attribute id { xs:ID } } /* notations for use within XML Schema schemas */ notation XMLSchemaStructures public "structures" system "http://www.w3.org/2000/08/XMLSchema.xsd" notation XML public "REC-xml-19980210" system "http://www.w3.org/TR/1998/REC-xml-19980210" /* Not the real urType, but as close an approximation as we can get in the XML representation */ complexType anyType { mixed ( { any }*, ) anyAttribute }