<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) <NAME> AS

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<xs:schema version="1.0" targetNamespace="http://signering.digipost.no/schema/v1/common" elementFormDefault="qualified"
           xmlns="http://signering.digipost.no/schema/v1/common"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">

    <xs:element name="error">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="error-code" minOccurs="1" maxOccurs="1" type="xs:string"/>
                <xs:element name="error-message" minOccurs="1" maxOccurs="1" type="xs:string"/>
                <xs:element name="error-type" minOccurs="1" maxOccurs="1" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="signature-job-id">
        <xs:restriction base="xs:string">
            <xs:maxLength value="50"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="url">
        <xs:restriction base="xs:string">
            <xs:maxLength value="500"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="signers">
        <xs:sequence>
            <xs:element name="signer" minOccurs="1" maxOccurs="1" type="signer"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="signer">
        <xs:sequence>
            <xs:element name="person" minOccurs="1" maxOccurs="1" type="person"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="person">
        <xs:sequence>
            <xs:element name="personal-identification-number" minOccurs="1" maxOccurs="1"
                        type="personal-identification-number"/>
        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="personal-identification-number">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9]{11}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="sender">
        <xs:sequence>
            <xs:element name="organization" minOccurs="1" maxOccurs="1" type="organization"/>
            <xs:element name="sender-identifier" minOccurs="0" maxOccurs="1">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:maxLength value="100"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="organization">
        <xs:simpleContent>
            <xs:restriction base="xs:string">
                <xs:pattern value="[0-9]{4}:\w{1,35}"/>
                <xs:attribute name="authority" type="iso6523-authority" use="optional" default="iso6523-actorid-upis"/>
            </xs:restriction>
        </xs:simpleContent>
    </xs:complexType>

    <xs:simpleType name="iso6523-authority">
        <xs:restriction base="xs:string">
            <xs:enumeration value="iso6523-actorid-upis"/>
        </xs:restriction>
    </xs:simpleType>
<commit_msg>Remove usage of iso6523 for organization identifiers. Seems like we'll only need the norwegian «organisasjonsnummer» at this time.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) <NAME> AS

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<xs:schema version="1.0" targetNamespace="http://signering.digipost.no/schema/v1/common" elementFormDefault="qualified"
           xmlns="http://signering.digipost.no/schema/v1/common"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd">

    <xs:element name="error">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="error-code" minOccurs="1" maxOccurs="1" type="xs:string"/>
                <xs:element name="error-message" minOccurs="1" maxOccurs="1" type="xs:string"/>
                <xs:element name="error-type" minOccurs="1" maxOccurs="1" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="signature-job-id">
        <xs:restriction base="xs:string">
            <xs:maxLength value="50"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="url">
        <xs:restriction base="xs:string">
            <xs:maxLength value="500"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="signers">
        <xs:sequence>
            <xs:element name="signer" minOccurs="1" maxOccurs="1" type="signer"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="signer">
        <xs:sequence>
            <xs:element name="person" minOccurs="1" maxOccurs="1" type="person"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="person">
        <xs:sequence>
            <xs:element name="personal-identification-number" minOccurs="1" maxOccurs="1"
                        type="personal-identification-number"/>
        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="personal-identification-number">
        <xs:restriction base="xs:string">
            <xs:pattern value="[0-9]{11}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="sender">
        <xs:sequence>
            <xs:element name="organization" minOccurs="1" maxOccurs="1" type="organization"/>
            <xs:element name="sender-identifier" minOccurs="0" maxOccurs="1">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:maxLength value="100"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="organization">
        <xs:simpleContent>
            <xs:restriction base="xs:string">
                <xs:pattern value="[0-9]{9}"/>
            </xs:restriction>
        </xs:simpleContent>
    </xs:complexType>

{'fraction_non_alphanumeric': 0.14921681780708987, 'fraction_numerical': 0.02019785655399835, 'mean_word_length': 2.5594132029339853, 'pattern_counts': {'":': 0, '<': 133, '<?xml version=': 2, '>': 133, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5684939', 'n_tokens_mistral': 2297, 'n_tokens_neox': 2167, 'n_words': 436}