<?xml version="1.0" encoding="utf-8"?>
<schema targetNamespace="http://ws.infotorg.no/xml/TRank/ReelleRettighetshavere/2011-09-16/ReelleRettighetshavere.xsd"
    xmlns:tns="http://ws.infotorg.no/xml/TRank/ReelleRettighetshavere/2011-09-16/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>
                    <simpleContent>
                      <extension base="string">
                        <attribute name="orgnr" type="string" use="required"/>
                        <attribute name="org_form" use="required" type="string"/>
                      </extension>
                    </simpleContent>
                  </complexType>
                </element>
                <element name="status">
                  <complexType>
                    <simpleContent>
                      <extension base="string">
                        <attribute name="andelRrh" type="string"/>
                        <attribute name="selveierskap" type="string"/>
                        <attribute name="sist_oppdatert" type="string"/>
                        <attribute name="aktivt" type="string"/>
                        <attribute name="børsnotert" type="string"/>
                      </extension>
                    </simpleContent>
                  </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>
                          <simpleContent>
                            <extension base="tns:obsFlag">
                              <attribute name="navn" type="string"/>
                              <attribute name="selveierskap" type="string"/>
                            </extension>
                          </simpleContent>
                        </complexType>
                      </element>
                    </sequence>
                  </complexType>
                </element>
              </sequence>
        </complexType>

      <group name="owners">
        <choice>
          <element name="enhet">
            <complexType>
              <simpleContent>
                <extension base="string">
                  <attribute name="orgnr" type="string" use="required"/>
                  <attribute name="org_form" use="required" type="string"/>
                  <attribute name="andel" type="string" use="required"/>
                  <attribute name="aktivt" type="string"/>
                  <attribute name="børsnotert" type="string"/>
                </extension>
              </simpleContent>
            </complexType>
          </element>
          <element name="person">
            <complexType>
              <simpleContent>
                <extension base="string">
                  <attribute name="f_dato" type="string" use="required"/>
                  <attribute name="andel" type="string"/>
                </extension>
              </simpleContent>
            </complexType>
          </element>
          <!-- Element ukjent var ikke med i xsd fra T-Rank  -->
          <element name="ukjent">
            <complexType>
              <simpleContent>
                <extension base="string">
                  <attribute name="andel" type="string"/>
                </extension>
              </simpleContent>
            </complexType>
          </element>
        </choice>
      </group>


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


</schema>



