<?xml version="1.0"?>
<xsd:schema xmlns="http://kofoed.no/xmlns/exchange/nor" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://kofoed.no/xmlns/exchange/nor" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.3" xml:lang="en">
	<xsd:element name="record" type="recordType" nillable="true" id="record.e">
		<xsd:annotation>
			<xsd:documentation>record is a top level container element for all of the field elements which compose the record</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="recordType" id="record.ct">
		<xsd:sequence minOccurs="0">
			<xsd:element name="leader" type="leaderFieldType" minOccurs="0"/>
			<xsd:element name="controlfield" type="controlFieldType" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element name="datafield" type="dataFieldType" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attribute name="format" type="xsd:NMTOKEN" use="optional"/>
		<xsd:attribute name="type" type="xsd:NMTOKEN" use="optional"/>
		<xsd:attribute name="id" type="idDataType" use="optional"/>
	</xsd:complexType>
	<xsd:complexType name="leaderFieldType" id="leader.ct">
		<xsd:annotation>
			<xsd:documentation>ISO 2709 Record Label, 24 bytes</xsd:documentation>
		</xsd:annotation>
		<xsd:simpleContent>
			<xsd:extension base="leaderDataType">
				<xsd:attribute name="id" type="idDataType" use="optional"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>
	<xsd:simpleType name="leaderDataType" id="leader.st">
		<xsd:restriction base="xsd:string">
			<xsd:whiteSpace value="preserve"/>
			<xsd:pattern value="\d{5}\p{IsBasicLatin}\p{IsBasicLatin}{4}\d\d\d{5}\p{IsBasicLatin}{3}\d\d\d\p{IsBasicLatin}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="controlFieldType" id="controlfield.ct">
		<xsd:annotation>
			<xsd:documentation>ISO 2709 Record Identifier and Reference Fields</xsd:documentation>
		</xsd:annotation>
		<xsd:simpleContent>
			<xsd:extension base="controlDataType">
				<xsd:attribute name="id" type="idDataType" use="optional"/>
				<xsd:attribute name="tag" type="controltagDataType" use="required"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>
	<xsd:simpleType name="controlDataType" id="controlfield.st">
		<xsd:restriction base="xsd:string">
			<xsd:whiteSpace value="preserve"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="controltagDataType" id="controltag.st">
		<xsd:restriction base="xsd:string">
			<xsd:whiteSpace value="preserve"/>
			<xsd:pattern value="00[1-9A-Za-z]"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="dataFieldType" id="datafield.ct">
		<xsd:annotation>
			<xsd:documentation>ISO 2709 data fields</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element name="subfield" type="subfieldatafieldType"/>
		</xsd:sequence>
		<xsd:attribute name="id" type="idDataType" use="optional"/>
		<xsd:attribute name="tag" type="tagDataType" use="required"/>
		<xsd:attribute name="ind1" type="indicatorDataType" use="optional"/>
		<xsd:attribute name="ind2" type="indicatorDataType" use="optional"/>
	</xsd:complexType>
	<xsd:simpleType name="tagDataType" id="tag.st">
		<xsd:restriction base="xsd:string">
			<xsd:whiteSpace value="preserve"/>
			<xsd:pattern value="(00[1-9A-Za-z]|0[1-9A-Za-z][0-9A-Za-z]|[1-9A-Za-z][0-9A-Za-z]{2})"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="indicatorDataType" id="ind.st">
		<xsd:restriction base="xsd:string">
			<xsd:whiteSpace value="preserve"/>
			<xsd:pattern value="\p{IsBasicLatin}{1}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="subfieldatafieldType" id="subfield.ct">
		<xsd:simpleContent>
			<xsd:extension base="subfieldDataType">
				<xsd:attribute name="id" type="idDataType" use="optional"/>
				<xsd:attribute name="code" type="subfieldcodeDataType" use="required"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>
	<xsd:simpleType name="subfieldDataType" id="subfield.st">
		<xsd:restriction base="xsd:string">
			<xsd:whiteSpace value="preserve"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="subfieldcodeDataType" id="code.st">
		<xsd:restriction base="xsd:string">
			<xsd:whiteSpace value="preserve"/>
			<xsd:pattern value="(\p{IsBasicLatin}|\p{IsLatin-1Supplement}){0,9}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="idDataType" id="id.st">
		<xsd:restriction base="xsd:IDREF"/>
	</xsd:simpleType>
</xsd:schema>

