<?xml version="1.0" encoding="utf-8"?>
<schema targetNamespace="http://ws.infotorg.no/xml/TRank/ReelleRettighetshavere/2019-05-13/ReelleRettighetshavere.xsd"
        xmlns:tns="http://ws.infotorg.no/xml/TRank/ReelleRettighetshavere/2019-05-13/ReelleRettighetshavere.xsd"
        xmlns:feil="http://ws.infotorg.no/xml/Feil/Feil.xsd"
        xmlns="http://www.w3.org/2001/XMLSchema">


    <annotation>
        <documentation xml:lang="no">
            Datatyper for Reelle rettighetshavere.

            © 2011 EDB ErgoGroup
            Forfatter: Even Aasland &lt;even.aasland@ergogroup.no&gt;
        </documentation>
    </annotation>


    <!-- Request -->
    <element name="hentReelleRettighetshavere">
        <complexType>
            <sequence>
                <element name="orgnr" type="int" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation xml:lang="no">Organisasjonsnummer</documentation>
                    </annotation>
                </element>
            </sequence>
        </complexType>
    </element>

    <!-- Response -->
    <element name="ReelleRettighetshavere" type="tns:ReelleRettighetshavereType"/>

    <complexType name="ReelleRettighetshavereType">
        <sequence>
            <element name="analyse" type="tns:analyseType" />
        </sequence>
    </complexType>

    <complexType name="analyseType">
        <sequence>
            <element name="bedrift" minOccurs="0">
                <complexType>
                    <sequence>
                        <element name="navn" type="string" />
                        <element name="orgnr" type="string" />
                        <element name="org_form" type="string" />
                    </sequence>
                </complexType>
            </element>
            <element name="status">
                <complexType>
                    <sequence>
                        <element name="status" type="string" />
                        <element name="aktivt" type="string" />
                        <element name="andelRrh" type="string" />
                        <element name="borsnotert" type="string" />
                        <element name="selveierskap" type="string" />
                        <element name="sist_oppdatert" type="string" />
                    </sequence>
                </complexType>
            </element>
            <element minOccurs="0" name="rrh">
                <complexType>
                    <group maxOccurs="unbounded" ref="tns:owners"/>
                </complexType>
            </element>
            <element minOccurs="0" name="arh">
                <complexType>
                    <group maxOccurs="unbounded" ref="tns:owners"/>
                </complexType>
            </element>
            <element minOccurs="0" name="obses">
                <complexType>
                    <sequence maxOccurs="unbounded">
                        <element name="obs">
                            <complexType>
                                <sequence>
                                    <element name="navn" type="string" />
                                    <element name="selveierskap" type="string" />
                                </sequence>
                            </complexType>
                        </element>
                    </sequence>
                </complexType>
            </element>
        </sequence>
    </complexType>

    <group name="owners">
        <choice>
            <element name="enhet">
                <complexType>
                    <sequence>
                        <element name="navn" type="string" />
                        <element name="aktivt" type="string" />
                        <element name="andel" type="string" />
                        <element name="borsnotert" type="string" />
                        <element name="org_form" type="string" />
                        <element name="orgnr" type="string" />
                    </sequence>
                </complexType>
            </element>
            <element name="person">
                <complexType>
                    <sequence>
                        <element name="navn" type="string" />
                        <element name="andel" type="string" />
                        <element name="f_dato" type="string" />
                    </sequence>
                </complexType>
            </element>
            <!-- Element ukjent var ikke med i xsd fra T-Rank  -->
            <element name="ukjent">
                <complexType>
                    <sequence>
                        <element name="navn" type="string" />
                        <element name="andel" type="string" />
                    </sequence>
                </complexType>
            </element>
        </choice>
    </group>

    <simpleType name="obsFlag">
        <restriction base="string">
            <enumeration value="B"/>
            <enumeration value="S"/>
        </restriction>
    </simpleType>


</schema>



