<?xml version="1.0"?>
<schema targetNamespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/EnhetForetak.xsd"
    xmlns:tns="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/EnhetForetak.xsd"
    xmlns:BasisdataMini="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BasisdataMini.xsd"
    xmlns:Basisdata="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Basisdata.xsd"
    xmlns:BasisdataFdato="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BasisdataFdato.xsd"
    xmlns:BedrifterVirksomheter="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BedrifterVirksomheter.xsd"
    xmlns:EnBedriftVirksomhet="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/EnBedriftVirksomhet.xsd"
    xmlns:Endringslogg="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Endringslogg.xsd"
    xmlns:Frivillighet="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Frivillighet.xsd"
    xmlns:Konsern="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Konsern.xsd"
    xmlns:Kontaktdata="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Kontaktdata.xsd"
    xmlns:OpplTilknRegister="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/OpplTilknRegister.xsd"
    xmlns:ProkuraSignatur="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/ProkuraSignatur.xsd"
    xmlns:ProkuraSignaturFdato="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/ProkuraSignaturFdato.xsd"
    xmlns:Roller="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Roller.xsd"
    xmlns:RollerFdato="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/RollerFdato.xsd"
    xmlns:Rolleutskrift="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Rolleutskrift.xsd"
    xmlns:SaerligeOpplysninger="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/SaerligeOpplysninger.xsd"
    xmlns:Grunndata="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Grunndata.xsd"
    xmlns:Forretningsforer="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Forretningsforer.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema">

    <annotation>
        <documentation xml:lang="no">
            Datatyper for Brønnøysundregistrene - Enhets- og foretaksregisteret.

            © 2006 ErgoGroup AS
            Forfatter: Dag Lem &lt;dag@nimrod.no&gt;
            QA: Morten Haugen &lt;morten.haugen@ifront.no&gt;
        </documentation>
    </annotation>
       
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BasisdataMini.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BasisdataMini.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Basisdata.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Basisdata.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BasisdataFdato.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BasisdataFdato.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BedrifterVirksomheter.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/BedrifterVirksomheter.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/EnBedriftVirksomhet.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/EnBedriftVirksomhet.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Endringslogg.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Endringslogg.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Frivillighet.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Frivillighet.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Konsern.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Konsern.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Kontaktdata.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Kontaktdata.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/OpplTilknRegister.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/OpplTilknRegister.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/ProkuraSignatur.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/ProkuraSignatur.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/ProkuraSignaturFdato.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/ProkuraSignaturFdato.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Roller.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Roller.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/RollerFdato.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/RollerFdato.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Rolleutskrift.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Rolleutskrift.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/SaerligeOpplysninger.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/SaerligeOpplysninger.xsd"/>
    <import
        namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Grunndata.xsd"
        schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Grunndata.xsd"/>
    <import
            namespace="http://ws.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Forretningsforer.xsd"
            schemaLocation="https://ws-test.infotorg.no/xml/Brreg/EnhetForetak/2012-08-27/Forretningsforer.xsd"/>

	<!-- Grunndata -->

    <complexType name="orgnrsoek">
        <sequence>
            <element name="orgnr" type="string"/>
        </sequence>
    </complexType>

    <complexType name="orgnrfoedselsnrsoek">
        <choice>
            <element name="orgnr" type="string"/>
            <element name="foedselsnr" type="string"/>
        </choice>
    </complexType>

    <complexType name="orgnrandelsnrsoek">
        <sequence>
            <element name="andelsnr" type="string"/>
            <element name="orgnr" type="string"/>
        </sequence>
    </complexType>


    <element name="hentTidligereNavn" type="tns:orgnrsoek"/>
    <element name="hentHovedinformasjonPrivat" type="tns:orgnrsoek"/>
    <element name="hentHovedinformasjonOffentlig" type="tns:orgnrsoek"/>

    <element name="hentBasisdataMini" type="tns:orgnrsoek"/>
    <element name="hentBasisdata" type="tns:orgnrsoek"/>
    <element name="hentBasisdataFdato" type="tns:orgnrsoek"/>
    <element name="hentBedrifterVirksomheter" type="tns:orgnrsoek"/>
    <element name="hentEnBedriftVirksomhet" type="tns:orgnrsoek"/>
    <element name="hentEndringslogg">
        <complexType/>
    </element>
    <element name="hentFrivillighet" type="tns:orgnrsoek"/>
    <element name="hentKonsern" type="tns:orgnrsoek"/>
    <element name="hentKontaktdata" type="tns:orgnrsoek"/>
    <element name="hentOpplTilknRegister" type="tns:orgnrsoek"/>
    <element name="hentProkuraSignatur" type="tns:orgnrsoek"/>
    <element name="hentProkuraSignaturFdato" type="tns:orgnrsoek"/>
    <element name="hentRoller" type="tns:orgnrsoek"/>
    <element name="hentRollerFdato" type="tns:orgnrsoek"/>
    <element name="hentRolleutskrift" type="tns:orgnrfoedselsnrsoek"/>
    <element name="hentSaerligeOpplysninger" type="tns:orgnrsoek"/>

    <element name="hentForretningsforer" type="tns:orgnrandelsnrsoek"/>

    <element name="HovedinformasjonOffentlig" type="tns:Hovedinformasjon"/>
    <element name="HovedinformasjonPrivat" type="tns:Hovedinformasjon"/>
    <element name="Forretningsforer" type="Forretningsforer:Forretningsforer"/>

    <complexType name="Hovedinformasjon">
        <sequence>
            <choice>
                <element ref="tns:Basisdata"/>
                <element ref="tns:BasisdataFdato"/>
            </choice>
            <element ref="tns:Grunndata"/>
            <element ref="tns:Kontaktdata"/>
            <element ref="tns:SaerligeOpplysninger"/>
            <element ref="tns:OpplTilknRegister"/>
	</sequence>
    </complexType>

    <element name="TidligereNavn" type="tns:TidligereNavn"/>

    <complexType name="TidligereNavn">
        <sequence>
            <element name="statuskode">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="ok"/>
                        <enumeration value="ingen"/>
                    </restriction>
                </simpleType>
            </element>
            <element name="statustekst" type="string"/>
            <element name="navneliste" maxOccurs="unbounded" minOccurs="1">
            <complexType>
                <sequence>
                  <element name="orgnr" type="string"/>
                  <element name="navn" maxOccurs="unbounded" minOccurs="0">
                    <complexType>
                      <simpleContent>
                        <extension base="string">
                          <attribute name="generasjon" type="integer"/>
                          <attribute name="endretdato" type="date"/>
                        </extension>
                      </simpleContent>
                    </complexType>
                  </element>
                </sequence>
            </complexType>
          </element>
        </sequence>
    </complexType>

    <element name="BasisdataMini">
        <complexType>
            <sequence>
                <element ref="BasisdataMini:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="Basisdata">
        <complexType>
            <sequence>
                <element ref="Basisdata:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="BasisdataFdato">
        <complexType>
            <sequence>
                <element ref="BasisdataFdato:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="BedrifterVirksomheter">
        <complexType>
            <sequence>
                <element ref="BedrifterVirksomheter:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="EnBedriftVirksomhet">
        <complexType>
            <sequence>
                <element ref="EnBedriftVirksomhet:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="Endringslogg">
        <complexType>
            <sequence>
                <element ref="Endringslogg:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="Frivillighet">
        <complexType>
            <sequence>
                <element ref="Frivillighet:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="Konsern">
        <complexType>
            <sequence>
                <element ref="Konsern:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="Kontaktdata">
        <complexType>
            <sequence>
                <element ref="Kontaktdata:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="OpplTilknRegister">
        <complexType>
            <sequence>
                <element ref="OpplTilknRegister:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="ProkuraSignatur">
        <complexType>
            <sequence>
                <element ref="ProkuraSignatur:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="ProkuraSignaturFdato">
        <complexType>
            <sequence>
                <element ref="ProkuraSignaturFdato:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="Roller">
        <complexType>
            <sequence>
                <element ref="Roller:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="RollerFdato">
        <complexType>
            <sequence>
                <element ref="RollerFdato:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="Rolleutskrift">
        <complexType>
            <sequence>
                <element ref="Rolleutskrift:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <element name="SaerligeOpplysninger">
        <complexType>
            <sequence>
                <element ref="SaerligeOpplysninger:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <!-- Bestilling -->

    <simpleType name="levmaatevalg">
        <restriction base="string">
            <enumeration value="post"/>
            <!--<enumeration value="telefaks"/>-->
            <enumeration value="epost"/>
        </restriction>
    </simpleType>

    <complexType name="leveringsadresse">
        <sequence>
            <element name="navn" type="string"/>
            <element name="postadresse" type="string" minOccurs="0"/>
            <element name="postnr" type="string"/>
            <element name="poststed" type="string"/>
            <element name="landkode" type="string" minOccurs="0"/>
            <element name="kontaktperson" type="string" minOccurs="0"/>
            <element name="leveringsmaate" type="tns:levmaatevalg"/>
            <element name="telefaks" type="string" minOccurs="0"/>
            <element name="epost" type="string" minOccurs="0"/>
        </sequence>
    </complexType>

    <group name="orgnr">
        <sequence>
            <element name="orgnr" type="string"/>
        </sequence>
    </group>

    <group name="orgnraar">
        <sequence>
            <element name="orgnr" type="string"/>
            <element name="aar" type="string"/>
        </sequence>
    </group>

    <complexType name="orgnrbestilling">
        <sequence>
            <group ref="tns:orgnr"/>
            <element name="leveringsadresse" type="tns:leveringsadresse"/>
        </sequence>
    </complexType>

    <complexType name="orgnraarbestilling">
        <sequence>
            <group ref="tns:orgnraar"/>
            <element name="leveringsadresse" type="tns:leveringsadresse"/>
        </sequence>
    </complexType>

<!--    <element name="hentBalanse" type="tns:orgnraarbestilling"/>-->
    <element name="hentBekreftelseKonkursregisteret" type="tns:orgnrbestilling"/>
    <element name="hentFirmaattest" type="tns:orgnrbestilling"/>
    <element name="hentFirmaattestEngelskSignert" type="tns:orgnrbestilling"/>
    <element name="hentFirmaattestSignert" type="tns:orgnrbestilling"/>
<!--    <element name="hentKonsernbalanse" type="tns:orgnraarbestilling"/>-->
<!--    <element name="hentKonsernresultatregnskap" type="tns:orgnraarbestilling"/>-->
    <element name="hentRegisterutskrift" type="tns:orgnrbestilling"/>
    <element name="hentRegisterutskriftFdato" type="tns:orgnrbestilling"/>
<!--    <element name="hentResultatregnskap" type="tns:orgnraarbestilling"/>-->
    <element name="hentTekstligeVedlegg" type="tns:orgnraarbestilling"/>
    <element name="hentAarsregnskap" type="tns:orgnraarbestilling"/>

    <element name="hentBestillingsstatus">
        <complexType>
            <sequence>
                <element name="referanse" type="long"/>
            </sequence>
        </complexType>
    </element>

    <complexType name="leveringsstatus">
        <sequence>
            <element name="status" type="string"/>
            <element name="referanse" type="long" minOccurs="0"/>
            <element name="feiltekst" type="string" minOccurs="0"/>
        </sequence>
    </complexType>

<!--    <element name="Balanse" type="tns:leveringsstatus"/>-->
    <element name="BekreftelseKonkursregisteret" type="tns:leveringsstatus"/>
    <element name="Firmaattest" type="tns:leveringsstatus"/>
    <element name="FirmaattestEngelskSignert" type="tns:leveringsstatus"/>
    <element name="FirmaattestSignert" type="tns:leveringsstatus"/>
<!--    <element name="Konsernbalanse" type="tns:leveringsstatus"/>-->
<!--    <element name="Konsernresultatregnskap" type="tns:leveringsstatus"/>-->
    <element name="Registerutskrift" type="tns:leveringsstatus"/>
    <element name="RegisterutskriftFdato" type="tns:leveringsstatus"/>
<!--    <element name="Resultatregnskap" type="tns:leveringsstatus"/>-->
    <element name="TekstligeVedlegg" type="tns:leveringsstatus"/>
    <element name="Aarsregnskap" type="tns:leveringsstatus"/>

    <element name="Bestillingsstatus">
        <complexType>
            <sequence>
                <element name="referanse" type="long"/>
                <element name="produkt" type="string"/>
                <element name="bestillingsstatus" type="string"/>
                <element name="bestillingsstatustekst" type="string"/>
                <element name="leveringsmaate" type="string"/>
                <element name="leveringsmaatetekst" type="string"/>
                <element name="leveringsstatus" type="string"/>
                <element name="leveringsstatustekst" type="string"/>
                <element name="levert" type="string"/>
                <any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
            </sequence>
        </complexType>
    </element>

    <!-- Indeks -->

    <group name="fkp">
        <choice>
            <element name="fylkesnr" type="string"/>
            <element name="kommunenr" type="string"/>
            <element name="postnr" type="string"/>
        </choice>
    </group>

    <simpleType name="tilgjengelighet">
        <restriction base="string">
            <enumeration value="A"/>
            <enumeration value="O"/>
            <enumeration value=""/>
        </restriction>
    </simpleType>

    <complexType name="navnesoek">
        <sequence>
            <element name="navn" type="string"/>
            <element name="fonetisk" type="boolean"/>
            <group ref="tns:fkp" minOccurs="0"/>
            <element name="naeringskode" type="string" minOccurs="0"/>
            <element name="tilgjengelighet" type="tns:tilgjengelighet" minOccurs="0"/>
            <element name="ekskl_slettet" type="boolean" minOccurs="0"/>
            <element name="ekskl_hist" type="boolean" minOccurs="0"/>
        </sequence>
    </complexType>

    <element name="hentNavneliste" type="tns:navnesoek"/>

    <element name="Navneliste">
        <complexType>
            <sequence>
                <element name="statuskode">
                    <simpleType>
                        <restriction base="string">
                            <enumeration value="ok"/>
                            <enumeration value="ingen"/>
                            <enumeration value="flere"/>
                        </restriction>
                    </simpleType>
                </element>
                <element name="statustekst" type="string"/>
                <element name="antall" type="integer" nillable="true"/>
                <element name="enheter">
                    <complexType>
                        <sequence>
                            <element name="enhet" minOccurs="0" maxOccurs="unbounded">
                                <complexType>
                                    <sequence>
                                        <element name="orgnr" type="string"/>
                                        <element name="navn" type="string"/>
                                        <element name="enhetstype" nillable="true" type="string"/>
                                        <element name="postnr" nillable="true" type="string"/>
                                        <element name="poststed" nillable="true" type="string"/>
                                        <element name="kommunenr" nillable="true" type="string"/>
                                        <element name="kommune" nillable="true" type="string"/>
                                        <element name="slettetdato" type="date" minOccurs="0"/>
                                        <element name="histtreff" type="boolean"/>
                                        <element name="hovedenhet" minOccurs="0">
                                                <complexType>
                                                        <sequence>
                                                                <element name="orgnr" type="string"/>
                                                                <element name="navn" type="string"/>
                                                                <element name="postnr" type="string" nillable="true"/>
                                                                <element name="poststed" type="string" nillable="true"/>
                                                        </sequence>
                                                </complexType>
                                        </element>
										<element name="tilgjengelighet" type="string"/>
                                        <any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
                                     </sequence>
                                </complexType>
                            </element>
                        </sequence>
                    </complexType>
                </element>
            </sequence>
        </complexType>
    </element>

    <element name="hentGrunndata" type="tns:orgnrsoek"/>

    <element name="Grunndata">
        <complexType>
            <sequence>
                <element ref="Grunndata:grunndata"/>
            </sequence>
        </complexType>
    </element>

    <!-- SVV AUTO -->
    <element name="hentSVVAuto" type="tns:orgnrsoek"/>

    <element name="SVVAuto" type="string"/>

    <element name="hentSVVAuto_v2" type="tns:orgnrsoek"/>

    <element name="SVVAuto_v2" type="string"/>

    <!-- element name="hentFirmaattestOnline" type="tns:orgnrsoek"/>

    <element name="FirmaattestOnline">
        <complexType>
            <sequence>
                <choice>
                    <element ref="tns:Basisdata"/>
                    <element ref="tns:BasisdataFdato"/>
                </choice>
                <element ref="tns:BedrifterVirksomheter"/>
                <element ref="tns:Kontaktdata"/>
                <element ref="tns:OpplTilknRegister"/>
                <choice>
                    <element ref="tns:ProkuraSignatur"/>
                    <element ref="tns:ProkuraSignaturFdato"/>
                </choice>
                <choice>
                    <element ref="tns:Roller"/>
                    <element ref="tns:RollerFdato"/>
                </choice>
                <element ref="tns:SaerligeOpplysninger"/>
            </sequence>
        </complexType>
    </element -->

    <element name="hentFrivillighetsregisteret" type="tns:orgnrsoek"/>

    <element name="Frivillighetsregisteret">
        <complexType>
            <sequence>
                <sequence minOccurs="0">
                    <choice>
                        <element ref="tns:Basisdata"/>
                        <element ref="tns:BasisdataFdato"/>
                    </choice>
                    <element ref="tns:Kontaktdata"/>
                    <element ref="tns:SaerligeOpplysninger"/>
                </sequence>
                <element ref="tns:Frivillighet"/>
            </sequence>
        </complexType>
    </element>

</schema>
