<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.deegree.org/services/wfs" targetNamespace="http://www.deegree.org/services/wfs"
  elementFormDefault="qualified" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">
  <annotation>
    <appinfo>
      <jaxb:schemaBindings>
        <jaxb:package name="org.deegree.services.jaxb.wfs" />
      </jaxb:schemaBindings>
    </appinfo>
  </annotation>
  <element name="deegreeWFS">
    <complexType>
      <sequence>
        <element name="SupportedVersions" minOccurs="0">
          <complexType>
            <sequence>
              <element name="Version" type="wfs:WFSVersionType" maxOccurs="unbounded" />
            </sequence>
          </complexType>
        </element>
        <element name="SupportedRequests" minOccurs="0" maxOccurs="1">
          <complexType>
            <sequence>
              <element name="SupportedEncodings" type="wfs:Encodings" minOccurs="0" />
              <element name="GetCapabilities" minOccurs="0" type="wfs:RequestType"/>
              <element name="DescribeFeatureType" minOccurs="0" type="wfs:RequestType"/>
              <element name="GetFeature" minOccurs="0" type="wfs:RequestType"/>
              <element name="Transaction" minOccurs="0" type="wfs:RequestType"/>
              <element name="GetFeatureWithLock" minOccurs="0" type="wfs:RequestType"/>
              <element name="GetGmlObject" minOccurs="0" type="wfs:RequestType"/>
              <element name="LockFeature" minOccurs="0" type="wfs:RequestType"/>
              <element name="GetPropertyValue" minOccurs="0" type="wfs:RequestType"/>
              <element name="CreateStoredQuery" minOccurs="0" type="wfs:RequestType"/>
              <element name="DropStoredQuery" minOccurs="0" type="wfs:RequestType" />
              <element name="ListStoredQueries" minOccurs="0" type="wfs:RequestType"/>
              <element name="DescribeStoredQueries" minOccurs="0" type="wfs:RequestType"/>
            </sequence>
          </complexType>
        </element>
        <element name="FeatureStoreId" minOccurs="0" maxOccurs="unbounded" type="string" />
        <element name="EnableTransactions" minOccurs="0" default="false">
          <complexType>
            <simpleContent>
              <extension base="boolean">
                <attribute name="idGen" type="wfs:IdentifierGenerationOptionType" use="optional" default="GenerateNew" />
                <attribute name="checkAreaOfUse" type="boolean" use="optional" default="false" />
              </extension>
            </simpleContent>
          </complexType>
        </element>
        <choice>
          <element name="EnableResponseBuffering" type="boolean" minOccurs="0" default="false" />
          <!-- DisableResponseBuffering is deprecated -->
          <element name="DisableResponseBuffering" type="boolean" minOccurs="0" default="true" />
        </choice>
        <element ref="wfs:DisabledResources" minOccurs="0" />
        <element name="EnableResponsePaging" type="boolean" minOccurs="0" default="false" />
        <element name="QueryCRS" type="string" minOccurs="1" maxOccurs="unbounded" />
        <element name="QueryMaxFeatures" type="integer" minOccurs="0" default="15000" />
        <element name="ResolveTimeOutInSeconds" type="positiveInteger" minOccurs="0" />
        <element name="QueryCheckAreaOfUse" type="boolean" minOccurs="0" default="false" />
        <element name="StoredQuery" type="string" minOccurs="0" maxOccurs="unbounded" />
        <element name="DefaultFormats" minOccurs="0" maxOccurs="1" >
          <complexType>
            <sequence>
              <element name="ExcludeMimeType" type="string" minOccurs="0" maxOccurs="unbounded" />
            </sequence>
          </complexType>
        </element>
        <element ref="wfs:AbstractFormat" minOccurs="0" maxOccurs="unbounded" />
        <element name="MetadataURLTemplate" minOccurs="0" type="string" />
        <element ref="wfs:FeatureTypeMetadata" minOccurs="0" maxOccurs="unbounded" />
        <element name="ExtendedCapabilities" minOccurs="0" maxOccurs="unbounded">
          <complexType>
            <sequence>
              <any processContents="lax">
                <annotation>
                  <appinfo>
                    <jaxb:dom />
                  </appinfo>
                </annotation>
              </any>
            </sequence>
            <attribute name="wfsVersions">
              <simpleType>
                <list itemType="wfs:WFSVersionType" />
              </simpleType>
            </attribute>
          </complexType>
        </element>
        <element name="Strict" minOccurs="0" type="boolean" default="false"/>
      </sequence>
      <attribute name="configVersion" type="string" use="optional"/>

    </complexType>
  </element>

  <element name="DisabledResources">
    <annotation>
      <documentation>Contains a sequence of url patterns which should not be resolved during transaction response.</documentation>
    </annotation>
    <complexType>
      <sequence>
        <element name="Pattern" type="string" minOccurs="1" maxOccurs="unbounded"/>
      </sequence>
    </complexType>
  </element>


  <!-- AbstractFormat and substitutions -->
  <element name="AbstractFormat" abstract="true" type="wfs:AbstractFormatType" />
  <complexType name="AbstractFormatType" abstract="true">
    <sequence>
      <element name="MimeType" type="string" maxOccurs="unbounded" />
    </sequence>
    <attribute name="wfsVersion" type="wfs:WFSVersionType" use="optional" />
  </complexType>
  <element name="GMLFormat" substitutionGroup="wfs:AbstractFormat">
    <complexType>
      <complexContent>
        <extension base="wfs:AbstractFormatType">
          <sequence>
            <element name="GenerateBoundedByForFeatures" type="boolean" minOccurs="0" default="false" />
            <element name="GetFeatureResponse" minOccurs="0">
              <complexType>
                <sequence>
                  <element name="ContainerElement" type="QName" minOccurs="0" />
                  <element name="FeatureMemberElement" type="QName" minOccurs="0" />
                  <element name="AdditionalSchemaLocation" type="string" minOccurs="0" />
                  <element name="DisableDynamicSchema" minOccurs="0" default="false">
                    <complexType>
                      <simpleContent>
                        <extension base="boolean">
                          <attribute name="baseURL" />
                        </extension>
                      </simpleContent>
                    </complexType>
                  </element>
                  <element name="SchemaLocation" type="string" minOccurs="0" />
                  <element name="DisableStreaming" type="boolean" minOccurs="0" default="false" />
                  <element name="PrebindNamespace" minOccurs="0" maxOccurs="unbounded">
                    <complexType>
                      <attribute name="prefix" use="required"/>
                      <attribute name="uri" use="required"/>
                    </complexType>
                  </element>
                </sequence>
              </complexType>
            </element>
            <element ref="wfs:AbstractCoordinateFormatter" minOccurs="0" />
            <element ref="wfs:GeometryLinearization" minOccurs="0" />
          </sequence>
          <attribute name="gmlVersion" type="wfs:GMLVersionType" use="required" />
        </extension>
      </complexContent>
    </complexType>
  </element>
  <element name="CustomFormat" substitutionGroup="wfs:AbstractFormat">
    <complexType>
      <complexContent>
        <extension base="wfs:AbstractFormatType">
          <sequence>
            <element name="JavaClass" type="string" />
            <element name="Config" type="anyType" />
          </sequence>
        </extension>
      </complexContent>
    </complexType>
  </element>
  <element name="CsvFormat" substitutionGroup="wfs:AbstractFormat" >
    <complexType>
      <complexContent>
        <extension base="wfs:AbstractFormatType">
          <sequence>
            <element name="ExtraColumns" minOccurs="0">
              <complexType>
                <sequence>
                  <element name="Identifier" type="string" minOccurs="0" />
                  <element name="CoordinateReferenceSystem" type="string" minOccurs="0" />
                </sequence>
              </complexType>
            </element>
          </sequence>
          <attribute name="encoding" type="string" />
          <attribute name="columnHeaders" type="wfs:ColumnHeaders" default="auto" />
          <attribute name="quoteCharacter" type="wfs:SingleCharacter" />
          <attribute name="escape" type="wfs:SingleCharacter" />
          <attribute name="delimiter" type="wfs:SingleCharacter" />
          <attribute name="instanceSeparator" type="string" default=" | "/>
          <attribute name="recordSeparator" type="string" />
          <attribute name="geometries" type="boolean" default="true" />
        </extension>
      </complexContent>
    </complexType>
  </element>
  <element name="GeoJSONFormat" substitutionGroup="wfs:AbstractFormat" >
    <complexType>
      <complexContent>
        <extension base="wfs:AbstractFormatType" >
          <attribute name="allowOtherCrsThanWGS84" type="boolean" default="false"/>
        </extension>
      </complexContent>
    </complexType>
  </element>

  <!-- AbstractCoordinateFormatter and substitutions -->
  <element name="AbstractCoordinateFormatter" abstract="true" />
  <element name="DecimalCoordinateFormatter" substitutionGroup="wfs:AbstractCoordinateFormatter">
    <complexType>
      <sequence />
      <attribute name="places" type="nonNegativeInteger" />
    </complexType>
  </element>
  <element name="CustomCoordinateFormatter" substitutionGroup="wfs:AbstractCoordinateFormatter">
    <complexType>
      <sequence>
        <element name="JavaClass" type="string" />
        <element name="Param" minOccurs="0" maxOccurs="unbounded">
          <complexType>
            <simpleContent>
              <extension base="string">
                <attribute name="name" type="string" use="required" />
              </extension>
            </simpleContent>
          </complexType>
        </element>
      </sequence>
    </complexType>
  </element>

  <element name="GeometryLinearization">
    <annotation>
      <documentation>Activates linearization for exporting non-linear curves/boundaries.</documentation>
    </annotation>
    <complexType>
      <sequence>
        <element name="Accuracy" type="double" />
      </sequence>
    </complexType>
  </element>

  <element name="FeatureTypeMetadata">
    <complexType>
      <sequence>
        <element name="Name" type="QName" />
        <element name="Title" type="string" minOccurs="0" />
        <element name="Abstract" type="string" minOccurs="0" />
        <element name="MetadataSetId" type="string" minOccurs="0" />
      </sequence>
    </complexType>
  </element>
  
  <complexType name="RequestType">
    <sequence>
      <element name="SupportedEncodings" minOccurs="0" type="wfs:Encodings" />
    </sequence>
  </complexType>

  <simpleType name="WFSVersionType">
    <restriction base="string">
      <enumeration value="1.0.0" />
      <enumeration value="1.1.0" />
      <enumeration value="2.0.0" />
    </restriction>
  </simpleType>

  <simpleType name="GMLVersionType">
    <restriction base="string">
      <enumeration value="GML_2" />
      <enumeration value="GML_30" />
      <enumeration value="GML_31" />
      <enumeration value="GML_32" />
    </restriction>
  </simpleType>

  <simpleType name="ColumnHeaders">
    <restriction base="string">
      <enumeration value="auto" />
      <enumeration value="short" />
      <enumeration value="prefixed" />
      <enumeration value="long" />
    </restriction>
  </simpleType>

  <simpleType name="SingleCharacter">
    <restriction base="string">
      <length value="1" />
    </restriction>
  </simpleType>

  <simpleType name="Encodings">
    <list>
      <simpleType>
        <restriction base="string">
          <enumeration value="kvp" />
          <enumeration value="xml" />
          <enumeration value="soap" />
        </restriction>
      </simpleType>
    </list>
  </simpleType>

  <simpleType name="IdentifierGenerationOptionType">
    <restriction base="string">
      <enumeration value="UseExisting">
        <annotation>
          <documentation>
            Indicates that the WFS will not generate new feature identifiers for inserted features.
            Instead, the WFS will use the identifier encoded in the feature. If a duplicate exists then the WFS will
            raise an exception.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="ReplaceDuplicate">
        <annotation>
          <documentation>
            Indicates that the WFS will not generate new feature identifiers for inserted features.
            Instead, the WFS will use the identifier encoded in the feature. If a duplicate exists then the WFS will
            replace the existing feature instance with the one encoded in the Insert action.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="GenerateNew">
        <annotation>
          <documentation>
            Indicates that the WFS will generate new and unique feature identifiers for inserted features.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="UseExistingResolvingReferencesInternally">
        <annotation>
          <documentation>
            Indicates that the WFS will not generate new feature identifiers for inserted features.
            Instead, the WFS will use the identifier encoded in the feature. If a duplicate exists then the WFS will
            raise an exception.
            Furthermore it is allowed to insert features with references to already inserted features as well as features from the GML to insert.
          </documentation>
        </annotation>
      </enumeration>
      <enumeration value="UseExistingSkipResolvingReferences">
        <annotation>
          <documentation>
            Indicates that the WFS will not generate new feature identifiers for inserted features.
            Instead, the WFS will use the identifier encoded in the feature. If a duplicate exists then the WFS will
            raise an exception.
            Furthermore during import feature references are not checked.
          </documentation>
        </annotation>
      </enumeration>
    </restriction>
  </simpleType>

</schema>
