<?xml version="1.0" encoding="UTF-16"?>
<?xml-stylesheet type="text/xsl" href="html.xsl"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:annotation>
		<xs:appinfo>ipcr_scheme_1-02.xsd</xs:appinfo>
	</xs:annotation>
	<xs:annotation>
		<xs:documentation>
			<h1>IPC Scheme Master file, Schema V.1.02</h1>
			<h2>File name of master files</h2>
			<div>ipcr_scheme_YYYYMMDD.xml</div>
			<h2>History</h2>
			<dl>
				<dt>
					<b>2005-MAY-19 TA</b>
				</dt>
				<dd>created from RIPCIS-1-00 DTD</dd>
				<dt>2005-JUN-12 TA</dt>
				<dd>validFrom, validTo removed; edition numbers converted to dates</dd>
				<dt>2005-OCT-01 TA</dt>
				<dd>adding translation element and changing lang element in IPCEntry<br/>
					purpose: language support for 3rd, 4th etc. language</dd>

				<dt>
					<b>2012-AUG-07 SzZ,TA</b>
				</dt>
				<dd>conversion to XSD</dd>
			</dl>
		</xs:documentation>
	</xs:annotation>


	<xs:include schemaLocation="inc-scheme_1-02.xsd"/>


	<xs:element name="revisionPeriods" type="revisionPeriods"/>
	<xs:complexType name="revisionPeriods">
		<xs:annotation>
			<xs:documentation>
				<div>wrapper for multiple revisionPeriod-s</div>
				<dl>
					<dt>root for <span class="fixed">ipcr_scheme_...</span>files</dt>
					<dd>exchange data of more (independent) revision periods can be stored in a single XML file</dd>
				</dl>
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="revisionPeriod" type="revisionPeriod" maxOccurs="unbounded"></xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="revisionPeriod">
		<xs:annotation>
			<xs:documentation>
				<div>schemes in one revisionPeriod</div>
				<div>In one revisionPeriod, that could be a "prereform","reformed" or "simplified" revision period,
					more ipcEdition-s can be stored (typically: in reformed IPC, core and advanced)</div>
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="ipcEdition" type="ipcEdition" maxOccurs="unbounded"></xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="ipcEdition">
		<xs:annotation>
			<xs:documentation>
				<div>one IPC edition (core or advanced)</div>
				<h3>Comment</h3>
				<ul>
					<li>May contain a single en or fr element, or a sequence of translation-s</li>
					<li>single language files are allowed</li>
				</ul>
				<h3>History</h3>
				<dl>
					<dt>20061001 TA</dt>
					<dd>modified added 'translation' element</dd>
				</dl>
			</xs:documentation>
		</xs:annotation>

		<xs:sequence>
			<xs:element name="en" type="enfrscheme" minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						<div>English scheme</div>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="fr" type="enfrscheme" minOccurs="0">
				<xs:annotation>
					<xs:documentation>
						<div>French scheme</div>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="translation" type="schemeTranslation" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>
						<div>Scheme in a non-authentic language.</div>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="edition" type="edition" use="required">
			<xs:annotation>
				<xs:documentation>e.g. 20060101</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ipcLevel" type="ipcLevel" use="required">
			<xs:annotation>
				<xs:documentation>
					<ul>
						<li>prereform editions: always core level</li>
						<li>revision periods in reformed IPC may contain a core and an advanced ipcEdition</li>
						<li>after simplification there is only a single advanced level ipcEndition-s</li>
					</ul>
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="documentRoot" type="xs:string" default="">
			<xs:annotation>
				<xs:documentation>
					<div>Obsolete technical attribute.</div>
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>


	<xs:complexType name="enfrscheme">
		<xs:annotation>
			<xs:documentation>
				<div>authentic language scheme</div>
				<div>Content is compatible to the translation element.</div>
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="staticIpc" type="staticIpc">
				<xs:annotation>
					<xs:documentation>
						<div>authentic language version of the IPC scheme</div>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>


	<xs:complexType name="schemeTranslation">
		<xs:annotation>
			<xs:documentation>
				<div>translation of IPC to a national language</div>
				<!--
			<h3>Structure</h3>
			<div>wrapper for staticIPC element</div>
			<h3>Attributes</h3>
			<dl>
				<dt>lang</dt><dd>language of the translation</dd>
			</dl>
			-->
				<h3>History</h3>
				<dl>
					<dt>20061001 TA</dt>
					<dd>added: for national language versions</dd>
				</dl>
			</xs:documentation>
		</xs:annotation>

		<xs:sequence>
			<xs:element name="staticIpc" type="staticIpc">
				<xs:annotation>
					<xs:documentation>
						<div>non-authentic language version of the IPC scheme</div>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="lang" type="lang" use="required"></xs:attribute>
	</xs:complexType>


	<xs:element name="staticIpc" type="staticIpc"/>

	<xs:complexType name="staticIpc">
		<xs:annotation>
			<xs:documentation>
				<div>final text of IPC in a single language</div>
				<h3>Comments</h3>
				<ol>
					<li>
						<b>in <span class="fixed">ipcr_scheme...</span> files:</b>
						<br/>the structure is embedded<br/>(parent-child relationship of data is reflected by the XML parent-child relationship)</li>
					<li>The structure allows non-embedded presentation of IPC entries</li>
					<!--
					<dt>
						<b>in RIPCIS:</b>
					</dt>
					<dd>the structure is not embedded,<br/>
						instead, ipcEntries can be handled as 'text records', (exact parent-child relationship 
					between ipcEntries is not reflected by the
					XML file)</dd>
					-->

					<!--
				<h3>Attributes</h3>
				<dl>
					<dt>lang</dt>
					<dd>(EN|FR) but not fixed to this list</dd>
					<dt>
						<b>edition</b>
					</dt>
					<dd>e.g. 20060101</dd>
					<dt>
						<b>ipcLevel</b>
					</dt>
					<dd>C(ore), A(dvanced)</dd>
					<dt>
						<b>documentRoot</b>
					</dt>
					<dd>obsolete, optional, presentation detail</dd>
				</dl>
-->
					<li>some attributes may be considered as redundant, for allowing staticIpc as root element (in RIPCIS).</li>
				</ol>
			</xs:documentation>
		</xs:annotation>

		<xs:sequence>
			<xs:element name="ipcEntry" type="ipcEntry" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>
						<div>IPC sections, i.e. kind attribute is 's'</div>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="lang" type="lang" default="EN"></xs:attribute>
		<xs:attribute name="edition" type="edition" use="required"></xs:attribute>
		<xs:attribute name="ipcLevel" type="ipcLevelCaps" default="C"/>
		<xs:attribute name="documentRoot" type="xs:string" default="">
			<xs:annotation>
				<xs:documentation>
					<div>Obsolete technical attribute.</div>
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>


	<xs:complexType name="ipcEntry">
		<xs:annotation>
			<xs:documentation>
				<div>representation of structured and non-structured elements of the IPC text</div>
				<h3>Comments</h3>
				<ol>
					<li>non-structured entries are: subsection titles, indexes, notes, guide headings</li>
					<li>for structured entries the symbol attribute must be unique in one language</li>
					<li>non-structured entries are identified by symbolTo attribute in case the scope of the non-structured entry overlaps more structured entries that are on the same level as the start of the scope</li>
					<li>a note that belongs to a sequence of ipcEntries is presented in the list 
					of the parent of the highest entry within its scope</li>
					<li>a non-structured entry (note,guidance heading, subsection title, line)
						must not contain embedded ipcEntry entries</li>
					<li>ipcEntry in compilation files has a different structure</li>
				</ol>
				<h3>History</h3>
				<dl>
					<dt>
						20051001 TA</dt>
					<dd>language code allows any two-letter language code</dd>
					<dd>obsolete EF language code maybe used at language-independent cases, e.g. deletions; EF is a non-existing 2-letter language code</dd>
				</dl>
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="textBody" type="schemeTextBody" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>may be empty in prereform editions, e.g. removed notes</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="ipcEntry" type="ipcEntry" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>
						<div>a subdivision of the parent ipcEntry or non-structured ipcEntry within the scope of the parent</div>
						<div>parent ipcEntry must be structured</div>
					</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attributeGroup ref="ipcEntryAttributes"/>
	</xs:complexType>
</xs:schema>