<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="https://schemas.rutdev.se/xsd/exchange/dataset-transfer/dataset-collection-transfer-1.0.xsd"
    xmlns:dataset="https://schemas.rutdev.se/xsd/entities/level1/dataset-1.0.xsd"
    xmlns:datasetcollection="https://schemas.rutdev.se/xsd/entities/level1/dataset-collection-1.0.xsd"
    xmlns:exchange="https://schemas.rutdev.se/xsd/exchange/dataset-transfer/types/exchange-types-1.0.xsd"
    targetNamespace="https://schemas.rutdev.se/xsd/exchange/dataset-transfer/dataset-collection-transfer-1.0.xsd"
    elementFormDefault="qualified"
    version="1.0">

    <!--
      DatasetCollectionTransfer Schema

      Description: DatasetCollectionTransfer is the root element for transferring dataset collection and dataset metadata. It is modelled after the legacy `dataSetCollectionTransfer` element in `rut-schemas/src/main/xsd...
      Version: 1.0
      Generated: 2026-04-22T06:56:44Z
      Source: specs/exchange/dataset-transfer/dataset-collection-transfer-1.0.md
    -->

    <!-- Import entity schemas -->
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level1/dataset-1.0.xsd"
        schemaLocation="../../entities/level1/1.0/dataset-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/entities/level1/dataset-collection-1.0.xsd"
        schemaLocation="../../entities/level1/1.0/dataset-collection-1.0.xsd"
    />
    <xsd:import
        namespace="https://schemas.rutdev.se/xsd/exchange/dataset-transfer/types/exchange-types-1.0.xsd"
        schemaLocation="types/exchange-types-1.0.xsd"
    />

    <!-- Main exchange type -->
    <xsd:complexType name="DatasetCollectionTransferType">
        <xsd:sequence>
            <xsd:element name="Meta" type="exchange:Meta" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Metadata about the specific export from the source system.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="DatasetCollections" type="datasetcollection:DatasetCollectionListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Dataset collections to transfer.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="Datasets" type="dataset:DatasetListType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>
                        Datasets to transfer.
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <!-- Root element -->
    <xsd:element name="DatasetCollectionTransfer" type="tns:DatasetCollectionTransferType"/>

</xsd:schema>