<?xml version="1.0" encoding="UTF-16"?>
<?xml-stylesheet type="text/xsl" hname="html.xsl" type="html.xsl"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:include schemaLocation="inc-types_1-02.xsd"/>

	<xs:annotation><xs:appinfo>ipcr_validity_1-01.xsd</xs:appinfo></xs:annotation>
	<xs:annotation>
		<xs:documentation>
			<h1>IPC Validity Master File, Schema V.1.01</h1>
	<h2>File name of master files</h2>
	<div>ipcr_validity_YYYYMMDD.xml</div>
			<div><b>Contacts:</b>WIPO: Patrick FIEVET (patrick.fievet@wipo.int).</div>
		</xs:documentation>
	</xs:annotation>

	<xs:element name="ipcr-validity-list">
		<xs:annotation>
			<xs:documentation>
				<div>set of subclass validity lists</div>
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="subclass-list" type="subclass-list" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:complexType name="subclass-list">
		<xs:annotation>
			<xs:documentation>
				<div>subclass container</div>
			</xs:documentation>
		</xs:annotation>

		<xs:sequence>
			<xs:element name="subclass-description" type="subclass-description"/>
			<xs:element name="ipcr-symbol" type="ipcr-symbol" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>


	<xs:complexType name="subclass-description">
		<xs:annotation>
			<xs:documentation>
				<div>section, class and subclass codes</div>
			</xs:documentation>
		</xs:annotation>

		<xs:sequence>
			<xs:element name="section" type="section"/>
			<xs:element name="class" type="class"/>
			<xs:element name="subclass" type="subclass"/>
		</xs:sequence>
	</xs:complexType>


	<xs:complexType name="ipcr-symbol">
		<xs:annotation>
			<xs:documentation>
				<div>validity interval related to a symbol</div>
	
<div>The time segment is defined as period of time during which the symbol and the following properties</div>
 
<ul><li>entry type</li>
<li>file scope (although not indicated in the validity file)</li>
</ul>
<div>did not change. It is described using "validity-date-from" and "validity-date-to"  validity dates of  each concerned IPC symbol.</div>

				<div>In case there is a change of file scope or entry type for a symbol, the validity file will contain as many records as necessary to describe the periods during which the file scope did not change for the same symbol.</div>
				<div>The entry appeared first in IPC at the version having the earliest validity-date-from attribute for a given symbol.</div>
				<div>In case there is no ipcr-symbol element with empty validity-date-to, the entry is not valid in IPC versions after the latest validity-date-to attribute for a given symbol.</div>
				<div>The complete symbol can be composed by assemling section,class, subclass elements of the enclosing subclass list and the main-group and group elements of the interval.</div>
			</xs:documentation>
		</xs:annotation>

		<xs:sequence minOccurs="0" maxOccurs="1">
			<xs:element name="main-group" type="main-group" minOccurs="1" maxOccurs="1"><xs:annotation><xs:documentation><div>optional main group number, when omitted: subclass validity list</div></xs:documentation></xs:annotation></xs:element>
			<xs:element name="subgroup" type="subgroup" minOccurs="1" maxOccurs="1"><xs:annotation><xs:documentation><div>optional subgroup number, when omitted: subclass validity list</div></xs:documentation></xs:annotation></xs:element>
		</xs:sequence>
		<xs:attribute name="classification-level" type="validityClassificationLevel" use="required">
		</xs:attribute>
		<xs:attribute name="entry-type" type="entryType" use="required">
			<xs:annotation><xs:documentation><div>Entry type codes are the same as in IPC Scheme.</div></xs:documentation></xs:annotation>
		</xs:attribute>
		<xs:attribute name="validity-date-from" type="edition" use="required"><xs:annotation><xs:documentation><div>mandatory, start of validity period for a given file scope</div></xs:documentation></xs:annotation></xs:attribute>
		<xs:attribute name="validity-date-to" type="edition"><xs:annotation><xs:documentation><div>optional, end of validity period for a given file scope</div><div>if empty: the maingroup, group or subclass is valid in the revision period</div><div>if not empty: always designates a later date than validity-entry-from</div></xs:documentation></xs:annotation></xs:attribute>
		<xs:attribute name="core-predecessor" type="symbol"><xs:annotation><xs:documentation><div>for subgroup symbols only</div><div>symbol of a core entry that embeds the subgroup</div>
		<div>In reformed IPC: the core predecessor can be a subgroup</div>
		<div>After 2011.01.01: core predecessor is always a main group</div></xs:documentation></xs:annotation></xs:attribute>
	</xs:complexType>

	<xs:simpleType name="validityClassificationLevel">
		<xs:annotation>
			<xs:documentation>
				<div>classification-level</div>
				<div>
				As from IPC 2011.01, </div>
				<ul>
<li>C= valid for Main Group symbols only</li>
<li>O= will not be used anymore</li>
<li>A= valid for subgroup symbols other than main groups only</li>
<li>S= valid for Subclass symbols</li>
</ul>
<div >IPC level is extended here with O (core only) and S (subclass)</div>
<div >O level is not used as last interval from version 2011.01</div>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:NMTOKEN">
			<xs:enumeration value="P">
				<xs:annotation>
					<xs:documentation>
						<div>Pre reform (i.e prior to IPC reform)</div>
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			
			<xs:enumeration value="C">
				<xs:annotation>
					<xs:documentation>
						<div>Core level(i.e for BOTH Core and Advanced Level classification)</div>
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="O">
				<xs:annotation>
					<xs:documentation>
						<div>valid for Core level symbol, Obsolete for the Advanced level  (i.e for Core level symbols no longer valid in the Advanced level)</div>
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="A">
				<xs:annotation>
					<xs:documentation>
						<div>Advanced level (i.e Advanced level classification ONLY)</div>
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="S">
				<xs:annotation>
					<xs:documentation>
						<div>Subclass level (i.e Subclass level classification ONLY)</div>
					</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>

	

	<xs:simpleType name="section">
		<xs:annotation>
			<xs:documentation>
			<div>section code</div>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[A-H]"><xs:annotation><xs:documentation><div>1 capital letter, A-H</div></xs:documentation></xs:annotation></xs:pattern>
		</xs:restriction>
	</xs:simpleType>


	<xs:simpleType name="class">
		<xs:annotation>
			<xs:documentation>
				<div>class code within the section</div>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[0-9]{2}"><xs:annotation><xs:documentation><div>2 digits</div></xs:documentation></xs:annotation></xs:pattern>
		</xs:restriction>
	</xs:simpleType>


	<xs:simpleType name="subclass">
		<xs:annotation>
			<xs:documentation>
				<div>subclass code within the class</div>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[A-Z]"><xs:annotation><xs:documentation><div>1 capital letter</div></xs:documentation></xs:annotation></xs:pattern>
		</xs:restriction>
	</xs:simpleType>


	<xs:simpleType name="main-group">
		<xs:annotation>
			<xs:documentation>
				<div>main group code within the subclass</div>
				<div>value: integer, 1-9999</div>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[1-9][0-9]{0,3}"><xs:annotation><xs:documentation><div>at most 4 digits, non-zero padded from the left</div></xs:documentation></xs:annotation></xs:pattern>
		</xs:restriction>
	</xs:simpleType>


	<xs:simpleType name="subgroup">
		<xs:annotation>
			<xs:documentation>
				<div>subgroup code within the maingroup</div>
				<div>value: digits, 00-999999</div>
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:pattern value="[0-9][0-9]"><xs:annotation><xs:documentation><div>two digits</div></xs:documentation></xs:annotation></xs:pattern>
			<xs:pattern value="[0-9][0-9][0-9]{0,3}[1-9]"><xs:annotation><xs:documentation><div>at most 6 digits, the last digit is not zero</div></xs:documentation></xs:annotation></xs:pattern>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>