<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
	xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
	datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

	<define name="collectionpattern">
		<attribute name="type">
			<value>collectionID</value>
		</attribute>
		<optional>
			<element name="datanamespace">
				<attribute name="abbrev"/>
				<attribute name="fullns"/>
			</element>
		</optional>
		<optional>
			<element name="xmlnamespace">
				<text/>
			</element>
		</optional>
	</define>

	<define name="imgpattern">
		<attribute name="type">
			<value>imgID</value>
		</attribute>
		<optional>
			<element name="datanamespace">
				<attribute name="abbrev"/>
				<attribute name="fullns"/>
			</element>
		</optional>

	</define>

	<define name="registrypattern">
		<attribute name="type">
			<value>registryID</value>
		</attribute>
		<element name="registryID">
			<text/>
		</element>
	</define>

	<define name="ctspattern">
		<attribute name="type">
			<value>ctsurn</value>
		</attribute>
	</define>



	<define name="datapattern">
		<attribute name="type">
			<value>data</value>
		</attribute>
		<optional>
			<element name="datanamespace">
				<text/>
			</element>
		</optional>
		<optional>
			<element name="xmlnamespace">
				<text/>
			</element>
			<element name="xpath">
				<text/>
			</element>
		</optional>
	</define>


	<start>
		<element name="idxstructure">
			<element name="refstructure">
				<choice>
					<ref name="collectionpattern"/>
					<ref name="imgpattern"/>
					<ref name="registrypattern"/>
					<ref name="ctspattern"/>
				</choice>
			</element>

			<element name="valuestructure">
				<choice>
					<ref name="collectionpattern"/>

					<ref name="imgpattern"/>
					<ref name="registrypattern"/>
					<ref name="ctspattern"/>
					<ref name="datapattern"/>

				</choice>
			</element>

		</element>
	</start>
</grammar>
