notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1885 - development/laboratory/schemas
- From: snesbitt AT cobaltgroup.com
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1885 - development/laboratory/schemas
- Date: Wed, 23 Feb 2005 22:24:18 +0100
Author: snesbitt AT cobaltgroup.com
Date: Wed Feb 23 22:24:17 2005
New Revision: 1885
Added:
development/laboratory/schemas/
development/laboratory/schemas/MagicIndex.rng (contents, props changed)
Log:
Publish initial attempt at index.xml RelaxNG schema.
Schema based on code crawl of index.xml parser.
Schema includes comments using the xhtml namespace.
Added: development/laboratory/schemas/MagicIndex.rng
==============================================================================
--- (empty file)
+++ development/laboratory/schemas/MagicIndex.rng Wed Feb 23 22:24:17
2005
@@ -0,0 +1,535 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Initial draft of RelaxNG schema for index document type along with
+ initial documentation. All documentation uses the xhtml namespace.
+ Derived from code base as of 2005-02-18 by S. Nesbitt
(snesbitt AT cobaltgroup.com).
+ -->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+ xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <ref name="IndexE"/>
+ </start>
+
+ <!-- Element Definitions -->
+ <!-- base resource attributes definition -->
+ <define name="BaseResourceAttrs">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>Basic Resource Attributes</xhtml:h1>
+ <xhtml:p>Description: Defines the common set of resource
attributes.
+ </xhtml:p>
+ <xhtml:p>
+ Attributes:
+ <xhtml:ul>
+ <xhtml:li>key - required attribute which references a
defined resource element.</xhtml:li>
+ <xhtml:li>
+ tag - optional; attribute of type int. Purpose is
unknown.
+ </xhtml:li>
+ <xhtml:li>
+ build - optional attribute of type boolean.
Indicates whether this is a build time dependency. Default is True
+ </xhtml:li>
+ <xhtml:li>
+ runtime - optional attribute of type boolean.
Indicates whether this is a runtime dependency. Default is True
+ </xhtml:li>
+ <xhtml:li>
+ test - optional attribute of type boolean. Indicates
whether this is a test dependency. Default is True
+ </xhtml:li>
+ </xhtml:ul>
+ </xhtml:p>
+ </xhtml:div>
+ <!-- definition -->
+ <attribute name="key">
+ <!-- NB - need to come up with a datatype for key. IDREF
doesn't work because
+ I can't guarantee that the corresponding ID will be defined
in the file. NMTOKEN
+ doesn't work because of the possible presence of # -->
+ </attribute>
+ <optional>
+ <attribute name="tag">
+ <data type="integer" />
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="build">
+ <data type="boolean" />
+ </attribute>
+ <!-- NB: boolean: "", case insentive true,case-insensitive
false" -->
+ </optional>
+ <optional>
+ <attribute name="runtime">
+ <data type="boolean" />
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="test">
+ <data type="boolean" />
+ </attribute>
+ </optional>
+ <text/>
+ </define>
+
+ <!-- "dependencies" element -->
+ <define name="DependenciesE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>dependencies</xhtml:h1>
+ <xhtml:p>Description: Container element for a project's resource
dependencies</xhtml:p>
+ <xhtml:p>Parent Elements: project, resource</xhtml:p>
+ <xhtml:p>Child Elements: include</xhtml:p>
+ </xhtml:div>
+ <!-- dependencies element definition -->
+ <element name="dependencies">
+ <zeroOrMore>
+ <ref name="DependencyIncludeE" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <!-- "includes" element (for dependencies) -->
+ <define name="DependencyIncludeE" >
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>include</xhtml:h1>
+ <xhtml:p>Description: Include element for a dependencies element
container</xhtml:p>
+ <xhtml:p>Parent Elements: dependencies</xhtml:p>
+ <xhtml:p>Child Elements: None</xhtml:p>
+ <xhtml:p>Attributes: see ExtendedResourceAttrs"</xhtml:p>
+ </xhtml:div>
+ <!-- dependencies element definition -->
+ <element name="include" >
+ <ref name="ExtendedResourceAttrs"/>
+ </element>
+ </define>
+
+ <!-- extended resource attribute definition -->
+ <define name="ExtendedResourceAttrs" >
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>Extends Resource Attributes</xhtml:h1>
+ <xhtml:p>Description: Extends the common set of resource
attributes to include a scope attribute.
+ </xhtml:p>
+ <xhtml:p>
+ Attributes:
+ <xhtml:ul>
+ <xhtml:li>see base resource attributes.</xhtml:li>
+ <xhtml:li>
+ scope - DEPRECATED. Optional attribute used to
distinguish strong and weak aggregation.
+ Valid values are 'scope' and 'link'. Default value
is LINK
+ </xhtml:li>
+ </xhtml:ul>
+ </xhtml:p>
+ </xhtml:div>
+ <!-- definition -->
+ <ref name="BaseResourceAttrs" />
+ <optional>
+ <attribute name="scope">
+ <choice>
+ <value>link</value>
+ <value>part</value>
+ </choice>
+ </attribute>
+ </optional>
+ </define>
+
+ <!-- "import" element -->
+ <define name="ImportE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>import</xhtml:h1>
+ <xhtml:p>
+ Identifies an external include of an index or module
definition
+ </xhtml:p>
+ <xhtml:p>Parent Elements: index</xhtml:p>
+ <xhtml:p>Child Elements: None</xhtml:p>
+ <xhtml:p>Attributes:
+ <xhtml:ul>
+ <xhtml:li>index - TBD</xhtml:li>
+ <xhtml:li>uri - an uri identifying the import
file</xhtml:li>
+ </xhtml:ul>
+ <xhtml:p>Note: the index and uri are essentially mutually
exclusive. Behavior when both are present
+ is implementation specific (in actuality "uri" is
processed only if index is not present or null). For purposes of
+ validation we will consider the presence of both
attributes a violation.</xhtml:p>
+ </xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="import">
+ <choice>
+ <attribute name="index">
+ <data type="token"/>
+ </attribute>
+ <attribute name="uri">
+ <data type="anyURI"/>
+ </attribute>
+ </choice>
+ </element>
+ </define>
+
+ <!-- "index" element -->
+ <define name="IndexE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>index</xhtml:h1>
+ <xhtml:p>
+ Description - the root element
+ </xhtml:p>
+ <xhtml:p>Parent Elements: None</xhtml:p>
+ <xhtml:p>Child Elements
+ <xhtml:ul>
+ <xhtml:li> 0...n import elements</xhtml:li>
+ <xhtml:li>0...n project elements</xhtml:li>
+ <xhtml:li>0...n resource elements</xhtml:li>
+ </xhtml:ul>
+ </xhtml:p>
+ <xhtml:p>Attributes
+ <xhtml:ul>
+ <xhtml:li>key - a unique identifier for the element.
Optional</xhtml:li>
+ </xhtml:ul>
+ </xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="index">
+ <optional>
+ <attribute name="key">
+ <data type="ID" />
+ </attribute>
+ </optional>
+ <interleave>
+ <zeroOrMore>
+ <ref name="ImportE"/>
+ </zeroOrMore>
+ <zeroOrMore>
+ <ref name="ProjectE" />
+ </zeroOrMore>
+ <zeroOrMore>
+ <ref name="ResourceE" />
+ </zeroOrMore>
+ </interleave>
+ </element>
+ </define>
+
+ <!-- "includes" element (for dependencies) -->
+ <define name="PartsIncludeE" >
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>include</xhtml:h1>
+ <xhtml:p>Description: Include element for a parts element
container</xhtml:p>
+ <xhtml:p>Parent Elements: dependencies</xhtml:p>
+ <xhtml:p>Child Elements: None</xhtml:p>
+ <xhtml:p>Attributes: see ExtendedResourceAttrs"</xhtml:p>
+ </xhtml:div>
+ <!-- dependencies element definition -->
+ <element name="include" >
+ <ref name="ExtendedResourceAttrs"/>
+ </element>
+ </define>
+
+ <!-- "includes" element (for plugins) -->
+ <define name="PluginsIncludeE" >
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>include</xhtml:h1>
+ <xhtml:p>Description: Include element for a plugins element
container</xhtml:p>
+ <xhtml:p>Parent Elements: dependencies</xhtml:p>
+ <xhtml:p>Child Elements: None</xhtml:p>
+ <xhtml:p>Attributes: see BaseResourceAttrs"</xhtml:p>
+ </xhtml:div>
+ <!-- dependencies element definition -->
+ <element name="include" >
+ <ref name="BaseResourceAttrs"/>
+ </element>
+ </define>
+
+ <!-- "project" element -->
+ <define name="ProjectE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>project element</xhtml:h1>
+ <xhtml:p>Element which defines a project</xhtml:p>
+ <xhtml:p>Child Elements
+ <xhtml:ul>
+ <xhtml:li>one "info" element</xhtml:li>
+ <xhtml:li>0...n "dependencies" element</xhtml:li>
+ <xhtml:li>0...n "plugins" element</xhtml:li>
+ <xhtml:li>0...n "parts" element</xhtml:li>
+ </xhtml:ul>
+ </xhtml:p>
+ <xhtml:p>Attributes:
+ <xhtml:ul>
+ <xhtml:li>key - optional; Assigns a unique reference to
the project</xhtml:li>
+ <xhtml:li>basedir - optional; directory path to the
project???</xhtml:li>
+ <xhtml:li>file - optional; name of the build
file</xhtml:li>
+ </xhtml:ul>
+ </xhtml:p>
+ </xhtml:div>
+ <!-- definition -->
+ <element name="project">
+ <!-- attributes -->
+ <optional>
+ <attribute name="key">
+ <data type="ID" />
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="basedir">
+ <!-- TBD: need to define a datatype -->
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="file">
+ <data type="NMTOKEN" />
+ <!-- NB: purpose unclear. source references build file
-->
+ </attribute>
+ </optional>
+ <!-- elements -->
+ <interleave>
+ <ref name="InfoE"/>
+ <interleave>
+ <zeroOrMore>
+ <ref name="DependenciesE"/>
+ </zeroOrMore>
+
+ <zeroOrMore>
+ <ref name="PluginsE"/>
+ </zeroOrMore>
+
+ <zeroOrMore>
+ <ref name="PartsE"/>
+ </zeroOrMore>
+ </interleave>
+ </interleave>
+ </element>
+ </define>
+
+ <!-- "type" element -->
+ <define name="ResourceTypeE" >
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>type element</xhtml:h1>
+ <xhtml:p>Parent Elements: info</xhtml:p>
+ <xhtml:p>Description: identifies the type of resource</xhtml:p>
+ <xhtml:p>Child Elements: None</xhtml:p>
+ <xhtml:p>Attributes: None</xhtml:p>
+ <xhtml:p>Note: default value is 'jar' </xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="type" >
+ <optional>
+ <text/>
+ </optional>
+ </element>
+ </define>
+
+ <!-- "types" element -->
+ <define name="ResourceTypesE" >
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>types element</xhtml:h1>
+ <xhtml:p>Parent Elements: info</xhtml:p>
+ <xhtml:p>Description: container element containing a set of type
elements</xhtml:p>
+ <xhtml:p>Child Elements: type</xhtml:p>
+ <xhtml:p>Attributes: None</xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="types" >
+ <zeroOrMore>
+ <ref name="ResourceTypeE" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="InfoE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>info element</xhtml:h1>
+ <xhtml:p>Parent Elements: project, resource</xhtml:p>
+ <xhtml:p>Description: Container element for information about a
resource</xhtml:p>
+ <xhtml:p>Child Elements:
+ <xhtml:ul>
+ <xhtml:li>group</xhtml:li>
+ <xhtml:li>name</xhtml:li>
+ <xhtml:li>type - optional</xhtml:li>
+ <xhtml:li>types - optional</xhtml:li>
+ <xhtml:li>version - optional</xhtml:li>
+ <xhtml:li>status - optional</xhtml:li>
+ </xhtml:ul>
+ </xhtml:p>
+ <xhtml:p>Note - the support of a "types" element containing a
set of "type" elements OR a set of "type"
+ elements without an enclosing "types" element strikes me as
unnecessarily complex making validation and
+ parsing unnecessarily complex. It might be better to remove
the option of a set of "type" elements not in
+ an enclosing "types" element.</xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="info">
+ <interleave>
+ <ref name="ResourceGroupE"/>
+ <ref name="ResourceNameE"/>
+ <optional>
+ <choice>
+ <ref name="ResourceTypesE"/>
+ <oneOrMore>
+ <ref name="ResourceTypeE" />
+ </oneOrMore>
+ </choice>
+ </optional>
+ <optional>
+ <ref name="ResourceVersionE"/>
+ </optional>
+ <optional>
+ <ref name="ResourceStatusE"/>
+ </optional>
+ </interleave>
+ </element>
+ </define>
+
+ <!-- "plugins" element -->
+ <define name="PluginsE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>plugins</xhtml:h1>
+ <xhtml:p>
+ Description - TBD
+ </xhtml:p>
+ <xhtml:p>Parent Elements: info</xhtml:p>
+ <xhtml:p>Child Elements: include</xhtml:p>
+ <xhtml:p>Attributes: None</xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="plugins">
+ <zeroOrMore>
+ <ref name="PluginsIncludeE" />
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <!-- "group" element -->
+ <define name="ResourceGroupE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>group element</xhtml:h1>
+ <xhtml:p>Description: a user defined category which serves to
relate a set of resources together</xhtml:p>
+ <xhtml:p>Children: None</xhtml:p>
+ <xhtml:p>Parent: info</xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="group">
+ <text/>
+ </element>
+ </define>
+
+ <!-- "name" element -->
+ <define name="ResourceNameE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>name</xhtml:h1>
+ <xhtml:p>Description: The assigned name of a resource. It is as
part of the algorithm for locating
+ a resource</xhtml:p>
+ <xhtml:p>Parent Elements: info</xhtml:p>
+ <xhtml:p>Child Elements: None</xhtml:p>
+ <xhtml:p>Attributes: None</xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="name">
+ <text/>
+ </element>
+ </define>
+
+ <!-- "status" element -->
+ <define name="ResourceStatusE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>status</xhtml:h1>
+ <xhtml:p>Description - TBD. If present value must be snapshot
(case insensitive)</xhtml:p>
+ <xhtml:p>Parent Elements: info</xhtml:p>
+ <xhtml:p>Child Elements: None</xhtml:p>
+ <xhtml:p>Attributes: None</xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="status">
+ <!-- N.B. Not happy with this. Should be an enumeration. But how
do we specify
+ that the value can be case insensitive? -->
+ <data type="string" >
+ <param
name="pattern">[Ss][Nn][Aa][Pp][Ss][Hh][Oo][Tt]</param>
+ </data>
+ </element>
+ </define>
+
+ <!-- "version" element -->
+ <define name="ResourceVersionE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>version</xhtml:h1>
+ <xhtml:p>
+ Description - the resource's version identifier. I suspect
+ this is also used as part of the algorithm for storing and
locating resources
+ </xhtml:p>
+ <xhtml:p>Parent Elements: info</xhtml:p>
+ <xhtml:p>Child Elements: None</xhtml:p>
+ <xhtml:p>Attributes: None</xhtml:p>
+ </xhtml:div>
+
+ <element name="version">
+ <text/>
+ </element>
+ </define>
+
+ <!-- "parts" element -->
+ <define name="PartsE">
+ <xhtml:div>
+ <xhtml:h1>parts</xhtml:h1>
+ <xhtml:p>
+ Description - TBD
+ </xhtml:p>
+ <xhtml:p>Parent Elements: info</xhtml:p>
+ <xhtml:p>Child Elements: include</xhtml:p>
+ <xhtml:p>Attributes: None</xhtml:p>
+ </xhtml:div>
+ <element name="parts">
+ <zeroOrMore>
+ <ref name="PartsIncludeE"/>
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <!-- "resource" element -->
+ <define name="ResourceE">
+ <!-- documentation -->
+ <xhtml:div>
+ <xhtml:h1>resource</xhtml:h1>
+ <xhtml:p>
+ Describes a non-project resource
+ </xhtml:p>
+ <xhtml:p>Parent Elements: index</xhtml:p>
+ <xhtml:p>Child Elements: info, include</xhtml:p>
+ <xhtml:p>Attributes:
+ <xhtml:ul>
+ <xhtml:li>key - a unique identifier assigned to the
resource</xhtml:li>
+ </xhtml:ul>
+ </xhtml:p>
+ </xhtml:div>
+
+ <!-- definition -->
+ <element name="resource">
+ <optional>
+ <!-- NB: Are Attributes shared with ProjectsE (which is
also a resource)? -->
+ <attribute name="key">
+ <!-- NB - need to come up with a datatype for key. ID
+ doesn't work because of the possible presence of # in the
name -->
+ </attribute>
+ </optional>
+ <ref name="InfoE"/>
+ <zeroOrMore>
+ <ref name="DependenciesE"/>
+ </zeroOrMore>
+ </element>
+ </define>
+
+</grammar>
- svn commit: r1885 - development/laboratory/schemas, snesbitt, 02/23/2005
Archive powered by MHonArc 2.6.24.