<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.deegree.org/layers/feature" xmlns:f="http://www.deegree.org/layers/feature"
  elementFormDefault="qualified" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0"
  xmlns:l="http://www.deegree.org/layers/base">

  <annotation>
    <appinfo>
      <jaxb:schemaBindings>
        <jaxb:package name="org.deegree.layer.persistence.feature.jaxb" />
      </jaxb:schemaBindings>
    </appinfo>
  </annotation>

  <import namespace="http://www.deegree.org/layers/base" schemaLocation="../../layers/base/base.xsd" />

  <complexType name="FeatureLayerType">
    <sequence>
      <element name="FeatureType" type="QName" minOccurs="0" />
      <!-- it's important to use xs:any instead of just an element with anyType here, else jaxb fails to properly generate 
        the dom! -->
      <element name="Filter" minOccurs="0">
        <complexType>
          <sequence>
            <any processContents="lax">
              <annotation>
                <appinfo>
                  <jaxb:dom />
                </appinfo>
              </annotation>
            </any>
          </sequence>
        </complexType>
      </element>
      <element name="SortBy" minOccurs="0">
        <complexType>
          <sequence>
            <any processContents="lax">
              <annotation>
                <appinfo>
                  <jaxb:dom />
                </appinfo>
              </annotation>
            </any>
          </sequence>
          <attribute name="reverseFeatureInfo" type="boolean" default="false" />
        </complexType>
      </element>
      <group ref="l:LayerInfo" />
    </sequence>
  </complexType>

  <element name="FeatureLayers">
    <complexType>
      <sequence>
        <choice>
          <sequence>
            <element name="FeatureStoreId" type="string" />
            <element name="FeatureLayer" type="f:FeatureLayerType" maxOccurs="unbounded" />
          </sequence>
          <element name="AutoLayers">
            <complexType>
              <sequence>
                <element name="FeatureStoreId" type="string" />
                <element name="StyleStoreId" type="string" minOccurs="0" />
              </sequence>
            </complexType>
          </element>
        </choice>
      </sequence>
      <attribute name="configVersion" type="string" use="optional"/>
    </complexType>
  </element>
</schema>