<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:strings="https://schemas.rutdev.se/xsd/types/strings-1.0.xsd"
    targetNamespace="https://schemas.rutdev.se/xsd/types/strings-1.0.xsd"
    elementFormDefault="qualified"
    version="1.0">

    <!--
      Strings Types Schema

      Description: Strings type definitions
      Version: 1.0
      Generated: 2026-04-22T06:56:44Z
      Source: specs/types/strings/1.0/
    -->

    <!-- Import XML namespace for xml:lang attribute -->
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"
                schemaLocation="http://www.w3.org/2001/xml.xsd"/>

    <!-- Short string with 1-255 characters, whitespace collapsed -->
    <xsd:simpleType name="ShortString">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="255"/>
            <xsd:whiteSpace value="collapse"/>
        </xsd:restriction>
    </xsd:simpleType>

    <!-- Long string with 1-8000 characters -->
    <xsd:simpleType name="LongString">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="8000"/>
        </xsd:restriction>
    </xsd:simpleType>

    <!-- Non-empty token suitable for identifiers -->
    <xsd:simpleType name="IdentifierToken">
        <xsd:restriction base="xsd:token">
            <xsd:minLength value="1"/>
        </xsd:restriction>
    </xsd:simpleType>

    <!-- Text with xml:lang attribute for language identification (SDMX TextType pattern) -->
    <xsd:complexType name="MultilingualText">
        <xsd:simpleContent>
            <xsd:extension base="xsd:string">
                <xsd:attribute ref="xml:lang" use="required"/>
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>

    <!-- Multilingual text with 1-255 character limit per language version -->
    <xsd:complexType name="MultilingualShortString">
        <xsd:simpleContent>
            <xsd:extension base="strings:ShortString">
                <xsd:attribute ref="xml:lang" use="required"/>
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>

    <!-- Multilingual text with 1-8000 character limit per language version -->
    <xsd:complexType name="MultilingualLongString">
        <xsd:simpleContent>
            <xsd:extension base="strings:LongString">
                <xsd:attribute ref="xml:lang" use="required"/>
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>

    <!-- Reference to another entity via its id_at_origin. Used for relationship elements in entity schemas. -->
    <xsd:complexType name="EntityReference">
        <xsd:sequence>
            <xsd:element name="ref" type="strings:IdentifierToken" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

</xsd:schema>