<?xml version="1.0" encoding="UTF-8"?>
<!--
    MetaLex 1.3
    Copyright (C) 2006  Leibniz Center for Law, Universiteit van Amsterdam

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-->
<!-- AB- This is a schema for the representation of the general structure of regulations. It is not jurisdiction-specific. The schema is intended to markup the parts of a regulation that can be referenced. 
-->
<!-- AB- This is the modular version of the schema. It includes metalexRef.xsd.
-->
<!-- AB- If you used types defined in the metalex: namespace, take note that all type definitions now have "Type" suffixed to their names to distinguish them from elements of the same name.
-->
<xsd:schema xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.metalex.nl/latest" targetNamespace="http://www.metalex.nl/latest">
	<xsd:include schemaLocation="metalexRef.xsd"/>
	<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">Access to xml:lang and xml:base</xsd:documentation>
		</xsd:annotation>
	</xsd:import>
	<!--<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2000/10/xml.xsd"/>
WARNING! If you get an error message in your editor or validator of choice relating to the xml: namespace (or the xml:lang or xml:base attribute), try replacing the import statement with this one, or omitting it altogether. The XML Spy validator and older Xerces validators may be fussy about this. -->
	<xsd:complexType name="SubPartType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">Part of an article. Member, Sub etc. Use this element when an article is divided into multiple parts.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="IndexDesignation">
				<xsd:annotation>
					<xsd:documentation>The Index designation added by the legislator to identify a textual element. Parts,articles and subparts are continuously numbered, optionally with some hierarchical levels. Citation title of a regulation (global identity) and index designation (local identity; e.g. article number) usually uniquely identify a part of a regulation. There is however a difference between indexicals into an array of textual elements and the index designation added by the legislator. The second article of a regulation may be called "article 3" (indicating a gap) or "article 1bis" (indicating later insertion).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element ref="Title" minOccurs="0"/>
			<xsd:choice>
				<xsd:element ref="SubPart" maxOccurs="unbounded"/>
				<xsd:sequence>
					<xsd:element ref="List"/>
					<xsd:element ref="Sentence" minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>
				<xsd:sequence>
					<xsd:element ref="Sentence" maxOccurs="unbounded"/>
					<xsd:choice minOccurs="0">
						<xsd:element ref="SubPart" maxOccurs="unbounded"/>
						<xsd:sequence>
							<xsd:element ref="List"/>
							<xsd:element ref="Sentence" minOccurs="0" maxOccurs="unbounded"/>
						</xsd:sequence>
					</xsd:choice>
				</xsd:sequence>
			</xsd:choice>
			<xsd:element ref="Annotation" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="MetaData" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attributeGroup ref="identityAttrs"/>
		<xsd:attributeGroup ref="temporalAttrs"/>
		<xsd:attributeGroup ref="extTemporalAttrs"/>
		<xsd:attributeGroup ref="descriptorAttrs"/>
		<xsd:anyAttribute namespace="##other" processContents="lax"/>
	</xsd:complexType>
	<xsd:complexType name="ListType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">A vertical, numbered list in a sentence whose sentence fragments are treated as subparts for purposes of reference.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="SentenceFragment"/>
			<xsd:element ref="SentenceFragmentSubPart" maxOccurs="unbounded"/>
			<xsd:element ref="SentenceFragment" minOccurs="0"/>
		</xsd:sequence>
		<xsd:attributeGroup ref="identityAttrs"/>
		<xsd:attributeGroup ref="temporalAttrs"/>
		<xsd:attributeGroup ref="extTemporalAttrs"/>
		<xsd:attributeGroup ref="descriptorAttrs"/>
		<xsd:anyAttribute namespace="##other" processContents="lax"/>
	</xsd:complexType>
	<xsd:complexType name="ArticleType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">A regulation consists of articles (optionally organizeded in parts, and subdivided in subparts).</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="IndexDesignation">
				<xsd:annotation>
					<xsd:documentation>Articles are continuously numbered. Citation title of a regulation and article nummer thus uniquely identify part of a regulation (regardless of any division in parts).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element ref="Title" minOccurs="0"/>
			<xsd:choice>
				<xsd:element ref="SubPart" maxOccurs="unbounded"/>
				<xsd:sequence>
					<xsd:element ref="List"/>
					<xsd:element ref="Sentence" minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>
				<xsd:sequence>
					<xsd:element ref="Sentence" maxOccurs="unbounded"/>
					<xsd:choice minOccurs="0">
						<xsd:element ref="SubPart" maxOccurs="unbounded"/>
						<xsd:sequence>
							<xsd:element ref="List"/>
							<xsd:element ref="Sentence" minOccurs="0" maxOccurs="unbounded"/>
						</xsd:sequence>
					</xsd:choice>
				</xsd:sequence>
			</xsd:choice>
			<xsd:element ref="Annotation" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="MetaData" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attributeGroup ref="identityAttrs"/>
		<xsd:attributeGroup ref="temporalAttrs"/>
		<xsd:attributeGroup ref="extTemporalAttrs"/>
		<xsd:attributeGroup ref="descriptorAttrs"/>
		<xsd:anyAttribute namespace="##other" processContents="lax"/>
	</xsd:complexType>
	<xsd:complexType name="SentenceFragmentSubPartType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">An indexed subpart (part of a list) that contains a part (SentenceFragment) of a sentence. </xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="IndexDesignation"/>
			<xsd:choice>
				<xsd:element ref="SentenceFragment"/>
				<xsd:element ref="List"/>
			</xsd:choice>
		</xsd:sequence>
		<xsd:attributeGroup ref="identityAttrs"/>
		<xsd:attributeGroup ref="temporalAttrs"/>
		<xsd:attributeGroup ref="extTemporalAttrs"/>
		<xsd:attributeGroup ref="descriptorAttrs"/>
		<xsd:anyAttribute namespace="##other" processContents="lax"/>
	</xsd:complexType>
	<xsd:complexType name="IndexDesignationType" mixed="true">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">A fixed identifier (name, rank; normative) for a part. Consists of a designation of the category (optional) and an index. Examples of category: member, chapter etc. Numbering of index can be 1,2,3 or a,b,c. The order of this numbering should be fixed. The Index designation is added by the legislator to identify a textual element. It is therefore part of the original text. CitationDesignation of a regulation (global identity) and IndexDesignation (local identity; e.g. article number) usually uniquely identify a part of a regulation. There is however a difference between indexicals into an array of textual elements and the index designation added by the legislator. The second article of a regulation may be called "article 3" (indicating a gap) or "article 1bis" (indicating later insertion).</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent mixed="true">
			<xsd:restriction base="xsd:anyType">
				<xsd:sequence>
					<xsd:element ref="Category" minOccurs="0"/>
					<xsd:element ref="Index"/>
				</xsd:sequence>
				<xsd:attribute ref="xml:lang"/>
				<xsd:attributeGroup ref="identityAttrs"/>
				<xsd:attributeGroup ref="temporalAttrs"/>
				<xsd:anyAttribute namespace="##other" processContents="lax"/>
			</xsd:restriction>
		</xsd:complexContent>
	</xsd:complexType>
	<xsd:complexType name="PartType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">A part of a document that contains a number of articles. Example: chapters, paragraph etc.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="IndexDesignation"/>
			<xsd:element ref="Title" minOccurs="0"/>			
			<xsd:choice minOccurs="0">
				<xsd:element ref="Part" maxOccurs="unbounded"/>
				<xsd:sequence>
					<xsd:element ref="Article" maxOccurs="unbounded"/>
					<xsd:element ref="Part" minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>
			</xsd:choice>
			<xsd:element ref="Annotation" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="MetaData" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attributeGroup ref="identityAttrs"/>
		<xsd:attributeGroup ref="temporalAttrs"/>
		<xsd:attributeGroup ref="extTemporalAttrs"/>
		<xsd:attributeGroup ref="descriptorAttrs"/>
		<xsd:anyAttribute namespace="##other" processContents="lax"/>
	</xsd:complexType>
	<xsd:complexType name="RegulationType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">The main element tag of a regulatory document.</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref="CitationDesignation" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Normative AR, but not always available.</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element ref="Introduction" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>Normative AR and grondwet, but not always available (e.g. BW).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:choice>
				<xsd:element ref="Article" maxOccurs="unbounded">
					<xsd:annotation>
						<xsd:documentation>(AR) A single article is designated 'enig artikel'.</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
				<xsd:element ref="Part" maxOccurs="unbounded">
					<xsd:annotation>
						<xsd:documentation xml:lang="en">Chapter, paragraph, Title, Part, etc. (normative AR)</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			</xsd:choice>
			<xsd:element ref="Conclusion" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation xml:lang="en">Normative in constitution for law and royal decree (KB).</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element ref="Appendix" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="Annotation" minOccurs="0" maxOccurs="unbounded"/>
			<xsd:element ref="MetaData" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
		<xsd:attributeGroup ref="identityAttrs"/>
		<xsd:attributeGroup ref="temporalAttrs"/>
		<xsd:attributeGroup ref="extTemporalAttrs"/>
		<xsd:attributeGroup ref="descriptorAttrs"/>
		<xsd:anyAttribute namespace="##other" processContents="lax"/>
	</xsd:complexType>
	<xsd:element name="Sentence" type="TextType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">A sentence.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="Title" type="TextType">
		<xsd:annotation>
			<xsd:documentation>The title (caption) of a part</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="IndexDesignation" type="IndexDesignationType">
		<xsd:annotation>
			<xsd:documentation>A fixed identifier (name, rank; normative) for a part. Consists of a designation of the category (optional) and an index. Examples of category: member, chapter etc. Numbering of index can be 1,2,3 or a,b,c. The order of this numbering should be fixed.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="SentenceFragment" type="TextType">
		<xsd:annotation>
			<xsd:documentation>A part of a sentence.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="Part" type="PartType">
		<xsd:annotation>
			<xsd:documentation>A part of a document that contains a number of articles. Example: chapters, paragraph etc.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="SentenceFragmentSubPart" type="SentenceFragmentSubPartType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">An indexed subpart (part of a list) that contains a part (SentenceFragment) of a sentence. </xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="List" type="ListType">
		<xsd:annotation>
			<xsd:documentation>A sentence that consists of a list.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="Article" type="ArticleType">
		<xsd:annotation>
			<xsd:documentation>A regulation consists of articles (optionally divided in parts).</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="SubPart" type="SubPartType">
		<xsd:annotation>
			<xsd:documentation xml:lang="en">Part of an article. Member, Sub etc. Use this element when an article is divided into multiple parts.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="CitationDesignation" type="TextType">
		<xsd:annotation>
			<xsd:documentation>The full designation at the top of the document identifying the regulation. This designation if often used to cite the regulation. In other cases a specific title, or specific titles, to be used for designation are found in some other place in the text. See the CitationTitle element for declarations of formal names of the regulation found in other places in the document.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="Introduction" type="TextType">
		<xsd:annotation>
			<xsd:documentation>A text between the title of the document and the declarative/directive part of the document that functions as an introduction. It may contain procedural information, and usually a statement of the purpose of the regulation.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="Conclusion" type="TextType">
		<xsd:annotation>
			<xsd:documentation>A text at the end of the primary document that contains formal language closing the document. Usually it contains information about who signed the regulation etc.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="Regulation" type="RegulationType">
		<xsd:annotation>
			<xsd:documentation xml:lang="nl">A written decision from a public body containing general prescriptions in the form of articles.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="Appendix" type="TextType">
		<xsd:annotation>
			<xsd:documentation>Some regulations will contain appendices that are referred to in the primary declarative/directive part of the regulation.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
</xsd:schema>

