<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rules SYSTEM "rules.dtd" [
	<!ENTITY statusnote "There are five possible levels: <br/> Req - Use of this element/attribute is required by the DTD.<br/> M-Use of this element/attribute is mandatory in order to meet  best practice guidelines. <br/>MA -Mandatory if Applicable to the situation.<br/> Rec- Use of this element/attribute is recommended but not required. <br/>Opt -This is an optional element/attribute.">
]>
<!--http://www.azizatech.com/rules/rulesdefinition.xml -->
<!--These are the application guidelines for the rules data model. It captures complex relationships and dependencies between elements and attributes, in order to be able to check a document against a Best Practice Guide. A stylesheet can then transform the rules into another stylesheet that can check a document  against the rules.
Developed by Elizabeth Shaw
Aziza Technology Associates
Pittsburgh PA
http://www.azizatech.com
ejshaw@azizatech.com
Basic document structure is:
rules
	group+
		title
		element+
			children*
				child+
				appnotes
			options*
				attributes+
				appnotes?
			attributes*
				values
					value?
				appnotes
			tests*
				test+
				appnotes
			appnotes?
			
			The DTD is freely available at http://www.azizatech.com/rules.rules.dtd for use   and modification as long as attribution for the original is maintained.

			 rulesdefinition.xml Version 0.8 2004-12-10
 Copyright (C) 2004 Aziza Technology Associates, LLC Pittsburgh, PA 
 http://www.azizatech.com
 This program is free software; you can redistribute it and/or modify 
 it under the terms of the Mozilla Public License available at 
http://www.mozilla.org/MPL/

 This program 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. 
 -->
<?xml-stylesheet type="text/xsl" href="rulestransform.xsl"?>
<rules date="2004-08-02">
	<title>Rules DTD Application Guidelines</title>
	<desc>
		<p>The rules data model captures complex relationships and dependencies between elements and attributes, in order to be able to check a document against a Best Practice Guide. A stylesheet can then transform the rules into another stylesheet that can check a document  against the rules.</p>
	</desc>
	<group>
		<title>Rules DTD Application Guidelines</title>
		<element path="rules/title" status="M" freq="single">
			<appnotes>A descriptive title of the Guidelines being Processed.</appnotes>
		</element>
		<element path="rules/desc" status="Opt" freq="single">
			<appnotes>Describes the purpose of the application.</appnotes>
		</element>
		<element path="rules/group" status="Req" freq="repeated">
			<children status="Req" include="all">
				<child>title</child>
			</children>
			<appnotes>A &lt;group&gt; contains elements to be processed in some sort of logical grouping. </appnotes>
		</element>
		<element path="rules/group/title" status="Req" freq="repeated">
			<appnotes>A title is required for each group of elements processed.</appnotes>
		</element>
		<element path="rules/group/desc" status="Opt" freq="repeated">
			<appnotes>Describes a &lt;group&gt;.</appnotes>
		</element>
		<element path="//desc/p" status="Req" freq="repeated">
			<appnotes> paragraph element used to format &lt;desc&gt;</appnotes>
		</element>
		<element path="rules/group/element" status="Req" freq="repeated">
			<attribute name="path" status="Req">
				<values type="cdata"/>
				<appnotes>Contains the xpath to the element being analyzed.</appnotes>
			</attribute>
			<attribute name="context" status="Rec">
				<values type="cdata"/>
				<appnotes>Contains a more human readable version of  @path for public display. This is recommend when the Xpath is complex, long or hard to read.</appnotes>
			</attribute>
			<attribute name="status" status="Req">
				<values type="multi">
					<value>Req</value>
					<value>M</value>
					<value>MA</value>
					<value>Rec</value>
					<value>Opt</value>
				</values>
				<appnotes>
	&statusnote;</appnotes>
			</attribute>
			<attribute name="freq" status="Req">
				<values type="multi">
					<value>single</value>
					<value>repeated</value>
				</values>
				<appnotes>If an element should occur only once set to 'single'. If the element is repeated anywhere in the document, set to 'repeated'. This allows for processing based on whether one or more are required/recommended.</appnotes>
			</attribute>
			<attribute name="test" status="Opt">
				<values type="cdata"/>
				<appnotes>@test contains a further condition that must be tested before the conditions in the description of the element are processed. It is in the form of  an xpath query. For example, if a parent element must exist before the element is checked,  you might test for the parent. If it isn't used in the document then the element will not be processed.  </appnotes>
			</attribute>
			<children status="MA" include="include">
				<child>attribute</child>
				<child>option</child>
				<child>tests</child>
				<child>children</child>
				<appnotes>Include one or more of the 4 as applicable, depending on the definition of the element and the application of the Best Practice Guides.</appnotes>
			</children>
			<children status="Opt" include="include">
				<child>appnotes</child>
				<appnotes>Include Application Notes in the element &lt;appnotes&gt; as applicable.</appnotes>
			</children>
			<appnotes>&lt;element&gt; captures requirements placed on an element.</appnotes>
		</element>
		<element path="//element/attribute|//element/option/attribute" status="M" freq="repeated">
			<attribute name="name" status="M">
				<values type="cdata"/>
				<appnotes>The name of an attribute.</appnotes>
			</attribute>
			<attribute name="status" status="Req">
				<values type="multi">
					<value>Req</value>
					<value>M</value>
					<value>MA</value>
					<value>Rec</value>
					<value>Opt</value>
				</values>
				<appnotes>
	&statusnote;</appnotes>
			</attribute>
			<attribute name="test" status="Opt">
				<values type="cdata"/>
				<appnotes>@test contains a further condition that must be tested before the conditions in the description of the attribute  are processed. It is in the form of  an xpath query. For example, @test may be used when an attribute is only used when another attribute is present.  </appnotes>
			</attribute>
			<children status="Opt" include="include">
				<child>appnotes</child>
				<appnotes>Include Application Notes in the element &lt;appnotes&gt; as applicable.</appnotes>
			</children>
			<appnotes>&lt;attribute&gt; captures attribute level requirements/recommendations placed on an element. May occur in  &lt;element&gt; or &lt;option&gt;</appnotes>
		</element>
		<element path="//attribute/values" status="Req" freq="repeated">
			<attribute name="type" status="Req">
				<values type="multi">
					<value>multi</value>
					<value>single</value>
					<value>pattern</value>
					<value>cdata</value>
				</values>
				<appnotes>
@type is required to determine what are allowed values for a particular attribute. <br/>'cdata' allows for any value. &lt;values&gt; remains an empty element in this case.<br/> 'multi' provides a pick list from the a list of values (in the child element &lt;value&gt;), <br/>'pattern' is an Xpath pattern specified in the content of the &lt;values&gt; element. single holds a single specified value defined in the contents of the  &lt;values&gt; element.</appnotes>
			</attribute>
			<attribute name="standard" status="Opt">
				<values type="cdata"/>
				<appnotes>@standard lists an applicable standard. For example iso8601 for date formats. This is used both in cases where a Xpath pattern (@type=pattern) is used and when cdata is constrained by a standard.  Standards currently allowed in the DTD iso8601 | iso639-2b | iso3166-1 | iso15924 | iso15511. This enumerated list could  be modified to include additional standards.</appnotes>
			</attribute>
			<children status="Opt" include="include">
				<child>appnotes</child>
				<appnotes>Include Application Notes in the element &lt;appnotes&gt; as applicable.</appnotes>
			</children>
			<appnotes>The element &lt;values&gt; contains information about  the allowable values for an attribute.</appnotes>
		</element>
		<element path="//value" status="MA" freq="repeated">
			<attribute name="crosswalk" status="Opt">
				<values type="multi">
					<value>MARC21</value>
					<value>DC</value>
					<value>ISAD-G-v2</value>
				</values>
				<appnotes>The optional crosswalk attribute allows you to map an attribute's value to it relevant standard. This enumerated list could be modified in the DTD to include other crosswalks. </appnotes>
			</attribute>
			<appnotes>Use when values/@type is set to 'multi'.</appnotes>
		</element>
		<element path="rules/element/option" status="Opt" freq="repeated">
			<children status="Req" include="all">
				<child>attribute</child>
				<appnotes>Must contain one or more &lt;attribute&gt;</appnotes>
			</children>
			<children status="Opt" include="include">
				<child>appnotes</child>
				<appnotes>Include Application Notes in the element &lt;appnotes&gt; as applicable.</appnotes>
			</children>
			<attribute name="status" status="Req">
				<values type="multi">
					<value>Req</value>
					<value>M</value>
					<value>MA</value>
					<value>Rec</value>
					<value>Opt</value>
				</values>
				<appnotes>
	&statusnote;</appnotes>
			</attribute>
			<attribute name="type" status="Req">
				<values type="single">oneof</values>
				<appnotes>Currently only 'oneof' is allowed. This allows for cases where one of several attributes is required depending on the local practice. For example, the &lt;eadid&gt; in EAD requires one of the attributes, @publicid or @url or @identifier as a way of uniquely identifying an object. Only one of them is applicable at a time. The enumerated list could be expanded to include other types in the way that &lt;children&gt; and &lt;tests&gt; have. </appnotes>
			</attribute>
		</element>
		<element path="//element/tests" status="Opt" freq="repeated">
			<attribute name="status" status="Req">
				<values type="multi">
					<value>Req</value>
					<value>M</value>
					<value>MA</value>
					<value>Rec</value>
					<value>Opt</value>
				</values>
				<appnotes>
	&statusnote;</appnotes>
			</attribute>
			<attribute name="include" status="Req">
				<values type="multi">
					<value>all</value>
					<value>include</value>
					<value>oneof</value>
				</values>
				<appnotes>When @include = 'all'. All tests must pass.<br/> When @include= 'include', the recommendation is that all be included but not required. When @include = 'oneof' , at least one test should pass. </appnotes>
			</attribute>
			<children status="M" include="all">
				<child>test</child>
			</children>
			<appnotes>&lt;tests&gt; groups a series of tests in the form of Xpath expressions that must be met if the element is to meet best practice.</appnotes>
		</element>
		<element path="//tests/test" status="M" freq="repeated">
			<appnotes>contains an Xpath expression to be tested when the element is present.</appnotes>
		</element>
		<element path="//children" status="Opt" freq="repeated">
			<attribute name="status" status="Req">
				<values type="multi">
					<value>Req</value>
					<value>M</value>
					<value>MA</value>
					<value>Rec</value>
					<value>Opt</value>
				</values>
				<appnotes>
	&statusnote;</appnotes>
			</attribute>
			<attribute name="include" status="Req">
				<values type="multi">
					<value>all</value>
					<value>include</value>
					<value>oneof</value>
				</values>
				<appnotes>When @include = 'all'. All must occur in the element. When @include= 'include', the recommendation is that all  be present but not required. When @include = 'oneof' , at least one should be present. </appnotes>
			</attribute>
			<children status="M" include="all">
				<child>child</child>
				<appnotes>Must contain at least one element &lt;child&gt;</appnotes>
			</children>
			<appnotes>&lt;children&gt; groups  sub- elements that should be present. </appnotes>
		</element>
		<element path="//children/child" status="Req" freq="repeated">
			<appnotes>Contains the name of an element to be tested for.</appnotes>
		</element>
		<element path="//br" status="Opt" freq="repeated">
			<appnotes>&lt;br/&gt; may be used within &lt;p&gt;, &lt;appnotes&gt; for formatting purposes.</appnotes>
		</element>
	</group>
</rules>
