<?xml version="1.0"?>
<schema targetNamespace="http://ws.infotorg.no/xml/Opplysningen1881/Opplysningen1881/2006-10-07/Opplysningen1881.xsd"
    xmlns:tns="http://ws.infotorg.no/xml/Opplysningen1881/Opplysningen1881/2006-10-07/Opplysningen1881.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema">

    <annotation>
        <documentation xml:lang="no">
            Datatyper for Opplysningen® 1881.

            © 2006 ErgoGroup AS
            Forfatter: Dag Lem &lt;dag@nimrod.no&gt;
        </documentation>
    </annotation>

    <!-- Søkeparametre A) / H) -->
    <group name="navnesoek">
        <sequence>
            <element name="tlfnr" type="string" minOccurs="0"/>
            <element name="etternavn" type="string" minOccurs="0"/>
            <element name="fornavn" type="string" minOccurs="0"/>
            <element name="gate" type="string" minOccurs="0"/>
            <element name="husnr" type="string" minOccurs="0"/>
            <element name="oppgang" type="string" minOccurs="0"/>
            <element name="postnr" type="string" minOccurs="0"/>
            <element name="poststed" type="string" minOccurs="0"/>
            <element name="kommune" type="string" minOccurs="0"/>
            <element name="fylke" type="string" minOccurs="0"/>
            <element name="landsdel" type="string" minOccurs="0"/>
            <element name="postboksnr" type="string" minOccurs="0"/>
            <element name="postbokstekst" type="string" minOccurs="0"/>
            <element name="postbokspostnr" type="string" minOccurs="0"/>
            <element name="postbokspoststed" type="string" minOccurs="0"/>
            <element name="katalogtype" type="string" minOccurs="0"/>
            <element name="bransje" type="string" minOccurs="0"/>
            <element name="bransjekode" type="string" minOccurs="0"/>
            <element name="riksannonsoer" type="string" minOccurs="0"/>
            <element name="teletjeneste" type="string" minOccurs="0"/>
            <element name="oppfoeringstype" type="string" minOccurs="0"/>
            <element name="virksomhetskode" type="string" minOccurs="0"/>
            <element name="fritekst" type="string" minOccurs="0"/>
        </sequence>
    </group>

    <!-- Søkeparametre B) -->
    <group name="visabnrhovedunder">
        <sequence>
            <element name="hovedabonnentnr" type="string"/>
            <element name="sekvensnr" type="string" minOccurs="0"/>
        </sequence>
    </group>

    <!-- Søkeparametre C) -->
    <group name="nummersoek">
        <sequence>
            <element name="tlfnr" type="string"/>
            <element name="virksomhetskode" type="string" minOccurs="0"/>
        </sequence>
    </group>

    <!-- Søkeparametre D) -->
<!--
    <group name="foretaksoek">
        <sequence>
            <element name="orgnr" type="string"/>
            <element name="virksomhetskode" type="string" minOccurs="0"/>
        </sequence>
    </group>
-->

    <!-- Søkeparametre E) / F) -->
    <group name="visabnr">
        <sequence>
            <element name="abonnentnr" type="string"/>
            <element name="sortering" type="string" minOccurs="0"/>
        </sequence>
    </group>

    <!-- Søkeparametre G) -->
<!--
    <group name="naerhetssoek">
        <sequence>
            <element name="fritekst" type="string"/>
            <element name="xkoord" type="string" minOccurs="0"/>
            <element name="ykoord" type="string" minOccurs="0"/>
            <element name="radius" type="string" minOccurs="0"/>
            <element name="katalogtype" type="string" minOccurs="0"/>
        </sequence>
    </group>
-->

    <element name="hentBransjer">
		<complexType>
			<sequence>
				<element name="bransje" type="string"/>
			</sequence>
		</complexType>
	</element>
    <element name="hentOppfoeringer">
		<complexType>
			<choice>
				<group ref="tns:navnesoek"/>
	<!--
				<group ref="tns:nummersoek"/>
				<group ref="tns:foretaksoek"/>
				<group ref="tns:naerhetssoek"/>
	-->
			</choice>
		</complexType>
	</element>
    <element name="hentHovedoppfoering">
		<complexType>
			<choice>
				<group ref="tns:navnesoek"/>
			</choice>
		</complexType>
	</element>
    <element name="hentOppfoeringerAbonnentnr">
		<complexType>
			<choice>
				<group ref="tns:visabnr"/>
				<group ref="tns:visabnrhovedunder"/>
			</choice>
		</complexType>
	</element>
    <element name="hentOppfoeringskontroll">
		<complexType>
			<choice>
				<group ref="tns:navnesoek"/>
			</choice>
		</complexType>
	</element>


    <group name="status">
        <sequence>
            <element name="TREFF" type="string"/>
            <choice>
                <element name="SVAR" type="string"/>
                <sequence>
                    <element name="FEILGRP" type="string"/>
                    <element name="FEILTXT" type="string"/>
                </sequence>
            </choice>
        </sequence>
    </group>

    <element name="Bransjer">
        <complexType>
            <sequence>
                <group ref="tns:status"/>
		<element name="BRN" minOccurs="0" maxOccurs="unbounded">
		    <complexType>
			<sequence>
			    <element name="BRNNIVAA" type="string"/>
			    <element name="BRNNAVN" type="string"/>
			    <element name="BRNKODE" type="string"/>
			    <element name="BRNHKODE" type="string"/>
			    <any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
			</sequence>
		    </complexType>
		</element>
            </sequence>
        </complexType>
    </element>

    <complexType name="oppfoeringer">
        <sequence>
            <group ref="tns:status"/>
	    <element name="OPPF" minOccurs="0" maxOccurs="unbounded">
		<complexType>
		    <sequence>
			<element name="ABNR" type="string"/>
			<element name="ENAVN" type="string"/>
			<element name="FNAVN" type="string"/>
			<element name="YRKE" type="string"/>
			<element name="EKSTRATXT" type="string"/>
			<element name="VEITYPE" type="string"/>
			<element name="VEINR" type="string"/>
			<element name="GATE" type="string"/>
			<element name="HUSNR" type="string"/>
			<element name="OPPG" type="string"/>
			<element name="POSTNR" type="string"/>
			<element name="POSTSTED" type="string"/>
			<element name="PB_POSTNR" type="string"/>
			<element name="PB_POSTSTED" type="string"/>
			<element name="PB_BOXNR" type="string"/>
			<element name="PB_BOXTXT" type="string"/>
			<element name="TLFTYPE" type="string"/>
			<element name="ISDN" type="string"/>
			<element name="KOMMNAVN_FO" type="string"/>
			<element name="KOMMNR_FO" type="string"/>
			<element name="TLFNR" type="string"/>
			<element name="ORGNR" type="string"/>
			<element name="KOMMNR" type="string"/>
			<element name="VIRKSKODE" type="string"/>
			<element name="KATDEL" type="string"/>
			<element name="OPPFDATO" type="string"/>
			<element name="KAT_TYPE" type="string"/>
			<element name="OPPFTYPE" type="string"/>
			<element name="TELETJ" type="string"/>
			<element name="RESERVASJON" type="string"/>
			<element name="STXT_TYPE" type="string"/>
			<element name="URL" type="string"/>
			<element name="NDC_OPPF_ID" type="string"/>
			<element name="XKOORD" type="string"/>
			<element name="YKOORD" type="string"/>
			<element name="AVST" type="string"/>
			<element name="RETN" type="string"/>
			<element name="ORGNR_AVD" type="string"/>
			<element name="EPOST" type="string"/>
			<element name="TELEFAKS" type="string"/>
			<element name="KOORDIND" type="string"/>
			<element name="TLF_MOB" type="string"/>
			<element name="UNDEROPPF" type="string"/>
			<element name="RUTE_ID" type="string"/>
			<element name="LINIDHOVED" type="string"/>
			<element name="NIVAA" type="string"/>
			<element name="USEQNR" type="string"/>
			<any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
		    </sequence>
		</complexType>
	    </element>
        </sequence>
    </complexType>

    <complexType name="oppfoeringskontroll">
        <sequence>
            <group ref="tns:status"/>
        </sequence>
    </complexType>

    <element name="Oppfoeringer" type="tns:oppfoeringer"/>
    <element name="Hovedoppfoering" type="tns:oppfoeringer"/>
    <element name="OppfoeringerAbonnentnr" type="tns:oppfoeringer"/>
    <element name="Oppfoeringskontroll" type="tns:oppfoeringskontroll"/>
</schema>
