<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://saxon.sf.net/ns/configuration" xmlns:saxon="http://saxon.sf.net/" xmlns:c="http://saxon.sf.net/ns/configuration">
  <xs:import namespace="http://saxon.sf.net/" schemaLocation="saxon-attributes.xsd"/>
  <xs:element name="configuration">
    <xs:complexType>
      <xs:all>
        <xs:element ref="c:global" minOccurs="0"/>
        <xs:element ref="c:serialization" minOccurs="0"/>
        <xs:element ref="c:collations" minOccurs="0"/>
        <xs:element ref="c:localizations" minOccurs="0"/>
        <xs:element ref="c:xslt" minOccurs="0"/>
        <xs:element ref="c:xquery" minOccurs="0"/>
        <xs:element ref="c:xsd" minOccurs="0"/>
        <xs:element ref="c:resources" minOccurs="0"/>
      </xs:all>
      <xs:attribute name="edition" use="optional" type="c:editionType"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="global">
    <xs:complexType>
      <xs:attribute name="allowExternalFunctions" use="optional" type="xs:boolean"/>
      <xs:attribute name="collationUriResolver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="collectionUriResolver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="compileToBytecode" use="optional" type="xs:boolean"/>
      <xs:attribute name="compileWithTracing" use="optional" type="xs:boolean"/>
      <xs:attribute name="defaultCollection" use="optional" type="xs:anyURI"/>
      <xs:attribute name="dtdValidation" use="optional" type="xs:boolean"/>
      <xs:attribute name="dtdValidationRecoverable" use="optional" type="xs:boolean"/>
      <xs:attribute name="errorListener" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="errorListenerFile" use="optional" type="c:fileNameType"/>
      <xs:attribute name="expandAttributeDefaults" use="optional" type="xs:boolean"/>
      <xs:attribute name="generateByteCode" use="optional" type="xs:boolean"/>
      <xs:attribute name="lazyConstructionMode" use="optional" type="xs:boolean"/>
      <xs:attribute name="lineNumbering" use="optional" type="xs:boolean"/>
      <xs:attribute name="optimizationLevel" use="optional" type="xs:integer"/>
      <xs:attribute name="parser" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="preEvaluateDoc" use="optional" type="xs:boolean"/>
      <xs:attribute name="preferJaxpParser" use="optional" type="xs:boolean"/>
      <xs:attribute name="recognizeUriQueryParameters" use="optional" type="xs:boolean"/>
      <xs:attribute name="schemaValidation" use="optional" type="c:schemaValidationType"/>
      <xs:attribute name="serializerFactory" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="sourceResolver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="standardErrorOutputFile" use="optional" type="c:fileNameType"/>
      <xs:attribute name="stripSpace" use="optional" type="c:stripSpaceType"/>
      <xs:attribute name="suppressEvaluationExpiryWarning" use="optional" type="xs:boolean"/>
      <xs:attribute name="timing" use="optional" type="xs:boolean"/>
      <xs:attribute name="traceExternalFunctions" use="optional" type="xs:boolean"/>
      <xs:attribute name="traceInstructions" use="optional" type="xs:boolean"/>
      <xs:attribute name="traceListener" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="traceListenerFile" use="optional" type="c:fileNameType"/>
      <xs:attribute name="traceOptimizerDecisions" use="optional" type="xs:boolean"/>
      <xs:attribute name="treeModel" use="optional" type="c:treeModelType"/>
      <xs:attribute name="uriResolver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="usePiDisableOutputEscaping" use="optional" type="xs:boolean"/>
      <xs:attribute name="useTypedValueCache" use="optional" type="xs:boolean"/>
      <xs:attribute name="validationWarnings" use="optional" type="xs:boolean"/>
      <xs:attribute name="versionOfXml" use="optional" type="xs:decimal"/>
      <xs:attribute name="xInclude" use="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="serialization">
    <xs:complexType>
	  <xs:attribute name="byte-order-mark" use="optional" type="c:yesOrNoType"/>
	  <xs:attribute name="cdata-section-elements" use="optional" type="c:listOfQNameType"/>
	  <xs:attribute name="doctype-public" use="optional" type="xs:string"/>
	  <xs:attribute name="doctype-system" use="optional" type="xs:anyURI"/>
	  <xs:attribute name="encoding" use="optional" type="xs:string"/>
	  <xs:attribute name="escape-uri-attributes" use="optional" type="c:yesOrNoType"/>
	  <xs:attribute name="include-content-type" use="optional" type="c:yesOrNoType"/>
      <xs:attribute name="indent" use="optional" type="c:yesOrNoType"/>
	  <xs:attribute name="media-type" use="optional" type="xs:string"/>
      <xs:attribute name="method" use="optional" type="xs:QName"/>
	  <xs:attribute name="normalization-form" use="optional" type="xs:string"/>
	  <xs:attribute name="omit-xml-declaration" use="optional" type="c:yesOrNoType"/>
	  <xs:attribute name="standalone" use="optional" type="c:yesOrNoOrOmitType"/>
	  <xs:attribute name="suppress-indentation" use="optional" type="c:listOfQNameType"/>
	  <xs:attribute name="undeclare-prefixes" use="optional" type="c:yesOrNoType"/>
	  <xs:attribute name="version" use="optional" type="xs:string"/>
      <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="collations">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="c:collation"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="collation">
    <xs:complexType>
	  <xs:attribute name="uri" use="required" type="xs:anyURI"/>
	  <xs:attribute name="alphanumeric" use="optional" type="c:yesOrNoOrCodepointType"/>
	  <xs:attribute name="case-order" use="optional" type="c:caseOrderType"/>
      <xs:attribute name="class" use="optional" type="c:javaClassNameType"/>
	  <xs:attribute name="decomposition" use="optional" type="c:decompositionType"/>
      <xs:attribute name="ignore-case" use="optional" type="c:yesOrNoType"/>
	  <xs:attribute name="ignore-modifiers" use="optional" type="c:yesOrNoType"/>
	  <xs:attribute name="ignore-width" use="optional" type="c:yesOrNoType"/>
      <xs:attribute name="lang" use="optional" type="xs:language"/>
	  <xs:attribute name="rules" use="optional" type="xs:string"/>
	  <xs:attribute name="strength" use="optional" type="c:strengthType"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="localizations">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="c:localization"/>
      </xs:sequence>
      <xs:attribute name="defaultCountry" use="optional" type="xs:NCName"/>
      <xs:attribute name="defaultLanguage" use="optional" type="xs:NCName"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="localization">
    <xs:complexType>
      <xs:attribute name="class" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="lang" use="optional" type="xs:language"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="xslt">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="c:extensionElement"/>
      </xs:sequence>
      <xs:attribute name="errorListener" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="errorListenerFile" use="optional" type="c:fileNameType"/>
      <xs:attribute name="messageReceiver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="outputUriResolver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="recoveryPolicy" use="optional" type="c:recoveryPolicyType"/>
      <xs:attribute name="schemaAware" use="optional" type="xs:boolean"/>
      <xs:attribute name="stylesheetParser" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="stylesheetUriResolver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="version" use="optional" type="xs:decimal"/>
      <xs:attribute name="versionWarning" use="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="extensionElement">
    <xs:complexType>
      <xs:attribute name="factory" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="namespace" use="optional" type="xs:anyURI"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="xquery">
    <xs:complexType>
      <xs:attribute name="allowUpdate" use="optional" type="xs:boolean"/>
      <xs:attribute name="constructionMode" use="optional" type="c:constructionModeType"/>
      <xs:attribute name="defaultElementNamespace" use="optional"/>
      <xs:attribute name="defaultFunctionNamespace" use="optional" type="xs:anyURI"/>
      <xs:attribute name="emptyLeast" use="optional" type="xs:boolean"/>
      <xs:attribute name="errorListener" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="errorListenerFile" use="optional" type="c:fileNameType"/>
      <xs:attribute name="inheritNamespaces" use="optional" type="xs:boolean"/>
      <xs:attribute name="moduleUriResolver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="preserveBoundarySpace" use="optional" type="xs:boolean"/>
      <xs:attribute name="preserveNamespaces" use="optional" type="xs:boolean"/>
      <xs:attribute name="requiredContextItemType" use="optional" type="c:itemTypeType"/>
      <xs:attribute name="version" use="optional" type="xs:decimal"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="xsd">
    <xs:complexType>
      <xs:attribute name="assertionsCanSeeComments" use="optional" type="xs:boolean"/>
      <xs:attribute name="multipleSchemaImports" use="optional" type="xs:boolean"/>
      <xs:attribute name="occurrenceLimits" use="optional" type="c:occurrenceLimitsType"/>
      <xs:attribute name="schemaUriResolver" use="optional" type="c:javaClassNameType"/>
      <xs:attribute name="useXsiSchemaLocation" use="optional" type="xs:boolean"/>
      <xs:attribute name="version" use="optional" type="xs:decimal"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="resources">
    <xs:complexType>
      <xs:all>
        <xs:element ref="c:externalObjectModel" minOccurs="0"/>
        <xs:element ref="c:schemaDocument" minOccurs="0"/>
        <xs:element ref="c:schemaComponentModel" minOccurs="0"/>
      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="externalObjectModel" type="c:javaClassNameType"/>
  <xs:element name="schemaDocument" type="xs:anyURI"/>
  <xs:element name="schemaComponentModel" type="xs:anyURI"/>

  <xs:simpleType name="constructionModeType">
    <xs:annotation>
	  <xs:documentation>
	    Defines how an XQuery processor will handle whitespace in element constructors. One of:
		  - strip - whitespace in the query is ignored
		  - preserve - whitespace in the query is copied to the result tree
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="strip"/>
	  <xs:enumeration value="preserve"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="caseOrderType">
    <xs:annotation>
	  <xs:documentation>
	    Used for the case-order property of a collation: defines whether lower-case collates
		before or after upper-case, other things being equal. One of: upper-first, lower-first
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="upper-first"/>
	  <xs:enumeration value="lower-first"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="decompositionType">
    <xs:annotation>
	  <xs:documentation>
	    Used for the decomposition property of a collation: defines whether a string
		is converted to decomposed normal form before comparisons are made, and if so,
		which form is to be used. One of: none, standard, or full.
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="none"/>
	  <xs:enumeration value="standard"/>
	  <xs:enumeration value="full"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="editionType">
    <xs:annotation>
	  <xs:documentation>
	    Code describing a Saxon product edition. One of:
		HE - home edition
		PE - professional edition
		EE - enterprise edition
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="HE"/>
	  <xs:enumeration value="PE"/>
	  <xs:enumeration value="EE"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="fileNameType">
    <xs:annotation>
	  <xs:documentation>
	    A file name, usually for output. Currently implemented simply as a string.
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string"/>
  </xs:simpleType>

  <xs:simpleType name="itemTypeType">
    <xs:annotation>
	  <xs:documentation>
	    An XPath item type, such as "item()", "node()", "element(*, xs:anyType)", or "xs:string".
		Currently implemented simply as a string.
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:minLength value="1"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="javaClassNameType">
    <xs:annotation>
	  <xs:documentation>
	    A fully-qualified Java class name: a sequence of identifiers separated by periods,
		where each identifier starts with a letter (or dollar or underscore), and continues
		with letters or digits (or dollar or underscore). The definition of "letter" used
		in this regular expression does not exactly match the Java definition, but the
		differences are unlikely to matter.
		May also be a zero-length string to indicate the default value.
	  </xs:documentation>
	</xs:annotation>
	<xs:restriction base="xs:string">
	  <xs:pattern value="(([\p{L}$_][\p{L}$_0-9]*)(\.[\p{L}$_][\p{L}$_0-9]*)*)?"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="listOfQNameType">
    <xs:annotation>
	  <xs:documentation>
	    A space-separated list of QNames. Used in serialization parameters such as
		cdata-section-elements.
	  </xs:documentation>
	</xs:annotation>
	<xs:list itemType="xs:QName"/>
  </xs:simpleType>

  <xs:simpleType name="occurrenceLimitsType">
    <xs:annotation>
	  <xs:documentation>
	    Highest values of minOccurs/maxOccurs for which accurate finite state automata should be
		generated during schema compilation. High limits can cause a large amount of memory to be used.
		Occurrence limits greater than these values may be non-strictly enforced.
		Format is a pair of integers, comma-separated.
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:pattern value="[0-9]+,\s*[0-9]+"/>
	</xs:restriction>
  </xs:simpleType>  


  <xs:simpleType name="recoveryPolicyType">
    <xs:annotation>
	  <xs:documentation>
	    Defines how an XSLT processor will handle recoverable errors. One of:
		  - recoverSilently - take the recovery action and continue silently
		  - recoverWithWarnings - take the recovery action and continue with a warning
		  - doNotRecover - terminate with a fatal error
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="recoverSilently"/>
	  <xs:enumeration value="recoverWithWarnings"/>
	  <xs:enumeration value="doNotRecover"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="schemaValidationType">
    <xs:annotation>
	  <xs:documentation>
	    A request for schema validation (or non-validation). One of:
		  strict     - validation must be performed
		  lax        - validation performed if an element declaration is available
		  preserve   - existing type annotations are retained
		  strip      - no validation performed, existing type annotations are dropped
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="strict"/>
	  <xs:enumeration value="lax"/>
	  <xs:enumeration value="preserve"/>
	  <xs:enumeration value="strip"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="strengthType">
    <xs:annotation>
	  <xs:documentation>
	    Defines the values of the strength property of a collation. 
		Defines which properties of a string are considered significant. One of:
		primary, secondary, tertiary, or identical.
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="primary"/>
	  <xs:enumeration value="secondary"/>
	  <xs:enumeration value="tertiary"/>
	  <xs:enumeration value="identical"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="stripSpaceType">
    <xs:annotation>
	  <xs:documentation>
	    Option for stripping whitespace in source documents. One of:
		  all        - all whitespace text nodes are removed, unless xml:space="preserve" is present
		  none       - no whitespace text nodes are removed
		  ignorable  - whitespace text nodes in element-only content (identified by schema or DTD) are stripped
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="all"/>
	  <xs:enumeration value="none"/>
	  <xs:enumeration value="ignorable"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="treeModelType">
    <xs:annotation>
	  <xs:documentation>
	    Choice of XDM tree model implementation for representing source documents. One of:
		  linkedTree         - mutable tree using one Java object per node
		  tinyTree           - compact immutable tree (default)
		  tinyTreeCondensed  - tinyTree with extra compression of text and attribute values
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="linkedTree"/>
	  <xs:enumeration value="tinyTree"/>
	  <xs:enumeration value="tinyTreeCondensed"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="yesOrNoType">
    <xs:annotation>
	  <xs:documentation>
	    Used for serialization parameters, and for collation parameters. One of "yes" or "no".
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="yes"/>
	  <xs:enumeration value="no"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="yesOrNoOrOmitType">
    <xs:annotation>
	  <xs:documentation>
	    Used for "standalone" serialization parameter. One of "yes" or "no" or "omit".
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="yes"/>
	  <xs:enumeration value="no"/>
	  <xs:enumeration value="omit"/>
	</xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="yesOrNoOrCodepointType">
    <xs:annotation>
	  <xs:documentation>
	    Used for "alphanumeric" property of a collation. One of "yes" or "no" or "codepoint".
	  </xs:documentation>
	</xs:annotation>
    <xs:restriction base="xs:string">
	  <xs:enumeration value="yes"/>
	  <xs:enumeration value="no"/>
	  <xs:enumeration value="omit"/>
	</xs:restriction>
  </xs:simpleType>

</xs:schema>
