<?xml version="1.0" encoding="ISO-8859-1"?>
<?dsd href="dsd2.dsd"?>
<!-- Change the above to reflect local conditions or reference
     the original at "http://www.brics.dk/DSD/dsd2.dsd" -->

<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
<!--

                            A DSD-2 Schema for Jakarta Ant

This DSD-2 schema is designed to provide a complete definition (as far as
information will allow) for the Jakarta Ant build files. It provides
extensibility for additional tasks and addresses the problems met
in previous schemas (DTD, XML Schema etc). The schema is made up of several
other imported files (see below).

The schema represents work in progress as the optional tasks remain 
unfinished, so any help here would be gratefully received. The whole thing
is still fairly raw although it has correctly validated all the Ant
build files that I use - and detected some errors in them that I had
not noticed :-)

Any bug reports, help, suggestions, new task schemas etc to me,
Hugh Field-Richards, at the Email below. I will include them as soon as
vacations, weekends, work etc allow.

If you need to locally extend the schema with you own tasks I have included the
Ant DSD validator task schema to show how this is done. 

The documentation (not HTML) is designed to be processed by the dsd2-html.xsl
pretty-printing processor available from the author.

 Author:
	Name  : Hugh Field-Richards.
	Email : h.field-richards@eris.qinetiq.com
	Snail : L313, QinetiQ, St Andrew's Road, Malvern.

(c) QinetiQ Ltd 2003

All copyright, database rights and other intellectual property in this
software is the property of QinetiQ limited.  The software is being released
free of charge for use in accordance with the terms of open source
initiative GNU General Public Licence.

DISCLAIMER:  QinetiQ Ltd does not verify or warrant the accuracy,
completeness or suitability of this software for any particular purpose.
Any use of this software whatsoever is entirely at the user's own risk and
QinetiQ Ltd accepts no liability in relation thereto.

   To Do :
   ==========================================================================

   1. Finish optional tasks in ant-optionalTasks.dsd

-->

<!DOCTYPE dsd:dsd [
   <!-- Used in annotation -->
   <!ENTITY lt       "&#38;#60;" >     <!-- less-than sign -->
   <!ENTITY gt       "&#62;" >         <!-- greater-than sign -->
   <!ENTITY dash     "&#x2010;" >      <!-- hyphen (true graphic) -->
   <!ENTITY ndash    "&#x2013;" >      <!-- en dash -->
   <!ENTITY mdash    "&#x2014;" >      <!-- em dash -->
   <!ENTITY ldquo    "&#x201c;" >      <!-- Left Double Quote -->
   <!ENTITY rdquo    "&#x201d;" >      <!-- Right Double Quote -->
   <!ENTITY lsquo    "&#x2018;" >      <!-- Left Single Quote -->
   <!ENTITY rsquo    "&#x2019;" >      <!-- Right Single Quote -->
   <!ENTITY bull     "&#x2022;" >      <!-- round bullet, filled -->
   <!ENTITY nbsp     "&#160;" >        <!-- no break space -->
   <!ENTITY rarr     "&#x2192;" >      <!-- right arrow -->
   <!ENTITY copy     "&#169;" >        <!-- copyright -->
] >

<!-- HSFR: The extra namespaces below are my local ones for the documentation. This could
be changed is required to make more universal. -->
<dsd:dsd
   xmlns:dsd="http://www.brics.dk/DSD/2.0"
	xmlns:m="http://www.brics.dk/DSD/2.0/meta"
	xmlns:doc="http://russet.eris.qinetiq.com/Library/DSDs/doc"
	xmlns:link="http://russet.eris.qinetiq.com/Library/DSDs/link"
	xmlns:list="http://russet.eris.qinetiq.com/Library/DSDs/list"
	xmlns:copyright="http://russet.eris.qinetiq.com/Library/DSDs/copyright"
	xmlns:address="http://russet.eris.qinetiq.com/Library/DSDs/address"
	xmlns:postcode="http://russet.eris.qinetiq.com/Library/DSDs/postcode"
	xmlns:person="http://russet.eris.qinetiq.com/Library/DSDs/person"
	xmlns:t="http://russet.eris.qinetiq.com/Library/DSDs/text"
	xmlns:vers="http://russet.eris.qinetiq.com/Library/DSDs/vers"
	root="project">

<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->

<m:doc>
	<doc:title>DSD for Jakarta Ant</doc:title>
	<doc:desc>
      <t:p>This DSD defines the structure of
      <link:link ref="http://ant.apache.org/" type="uri">Jakarta Ant</link:link>
      build files. It is the top level schema
      which imports all the various parts of the entire schema. The <t:code type="dir">&lt;project&gt;</t:code>
      element is defined here as well since is is the document root.</t:p>
      <t:p>There are one or two things to note here:</t:p>
      <list:list type="unordered">
         <list:item><t:p>The Ant build files do not have an associated namespace so
            I am not defining the lements with one (I usually do so in other schemas).
            Perhaps the Ant Version 2 will?</t:p></list:item>
         <list:item><t:p>I do not use defaults in this file as they may well change in the Ant processor.
      It is unlikely that this schema will be used for anything other than validation, not translation
      for expanding defaults. You could use XSL Transform if this is required.</t:p></list:item>
      </list:list>
      <t:p>Beware my version numbering - it got a little wayward at the start - only believe what is
      in this file after 0.15! I try and give sub files the same number as this one but in the early days
      it didn't work :-(</t:p>
   </doc:desc>
	<doc:versions>
      <vers:entry vers="0.00" day="15" month="April" year="2003" who="HSFR">Created</vers:entry>
      <vers:entry vers="0.10" day="2" month="May" year="2003" who="HSFR">First released version</vers:entry>
      <vers:entry vers="0.11" day="12" month="May" year="2003" who="HSFR">Corrected targetName definition</vers:entry>
      <vers:entry vers="0.12" day="13" month="May" year="2003" who="HSFR">Added non-empty string definition and cured empty echo problem</vers:entry>
      <vers:entry vers="0.13" day="19" month="June" year="2003" who="HSFR">Added path element</vers:entry>
      <vers:entry vers="0.15" day="25" month="July" year="2003" who="HSFR">Added Ant Contr Tasks and cured bug in ant-tasks</vers:entry>
      <vers:entry vers="0.16" day="5" month="July" year="2004" who="HSFR">See ant-tasks</vers:entry>
      <vers:entry vers="0.17" day="5" month="July" year="2004" who="HSFR">See ant-tasks</vers:entry>
  </doc:versions>
  <doc:authors>
    <person:person id="HSFR">
	    <person:forenames>
			  <list:list type="ordered">
			    <list:item><person:forename type="primary">Hugh</person:forename></list:item>
			    <list:item><person:forename>Sherwood</person:forename></list:item>
			  </list:list>
      </person:forenames>
		  <person:surname>Field-Richards</person:surname>
		  <person:email>h.field-richards@eris.qinetiq.gov.uk</person:email>
		  <person:address>
		    <address:address where="work">
		      <address:line numb="1">Room L313</address:line>
			   <address:line numb="2">QinetiQ</address:line>
			   <address:line numb="3">St Andrew's Road</address:line>
			   <address:town>Malvern</address:town>
			   <address:county>Worcs</address:county>
			   <address:country>United Kingdom</address:country>
			   <postcode:postcode>WR14 3PS</postcode:postcode>
			  </address:address>
		  </person:address>
    </person:person>
  </doc:authors>
  <doc:copyright>
    <copyright:who value="QinetiQ" />
    <copyright:date value="2003" />
    <copyright:leader value="Copyright" />
  </doc:copyright>
</m:doc>

<dsd:import href="ant-common.dsd"/>
<dsd:import href="ant-selectors.dsd"/>
<dsd:import href="ant-filterchains.dsd"/>
<dsd:import href="ant-sets.dsd"/>
<dsd:import href="ant-tasks.dsd"/>
<dsd:import href="ant-optionalTasks.dsd"/>
<dsd:import href="ant-contrib.dsd"/>
<dsd:import href="ant-targets.dsd"/>
<dsd:import href="ant-extensions.dsd"/>

<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->

<dsd:if><dsd:element name="project" />
	<m:doc>
		<doc:desc>
      <t:heading level="2">Projects</t:heading>
			<t:p>Each build file contains one project with an optional
         <t:code type="var">name</t:code>. The default is required and refers to the
         target that must be used when the target is left out of the
         command. The <t:code type="var">basedir</t:code> is from where all path
         calculations are done. For example</t:p>
         <t:verbatim>
   &lt;project name="myProject" default="all" basedir="." &gt;
      ...
   &lt;/project&gt;
         </t:verbatim>
		</doc:desc>
	</m:doc>
   <dsd:declare>
      <dsd:attribute name="name" />
      <dsd:attribute name="basedir" />
      <dsd:required><dsd:attribute name="default" /></dsd:required>
      <dsd:contents>
         <dsd:repeat min="0">
            <dsd:union>
               <dsd:element name="path" />
               <dsd:element name="target" />
               <dsd:element name="property" />
               <dsd:element name="patternset" />
               <dsd:element name="taskdef" />
               <dsd:element name="description" />
            </dsd:union>
         </dsd:repeat>
      </dsd:contents>
   </dsd:declare>
</dsd:if>
   
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->

<dsd:if><dsd:element name="project" />
	<m:doc>
		<doc:desc>
      <t:p>All defaults should be resolved in a target name.</t:p>
		</doc:desc>
	</m:doc>
   <dsd:pointer>
      <dsd:and>
         <dsd:element name="target"/>
         <dsd:attribute name="name"/>
      </dsd:and>
      <dsd:attributefield name="default" />
   </dsd:pointer>
</dsd:if>

<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->
<!-- -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -->

<dsd:if>
   <dsd:or>
      <dsd:boolexp ref="taskElements"/>
      <dsd:boolexp ref="sets"/>
      <dsd:element name="filelist"/>
   </dsd:or>
	<m:doc>
		<doc:desc>
         <t:p>The <t:code type="var">id</t:code> must be unique within the file.</t:p>
		</doc:desc>
	</m:doc>
   <dsd:rule ref="commonAttributes" />
	<dsd:unique>
      <dsd:attribute name="id"/>
      <dsd:attributefield name="id"/>
   </dsd:unique>
</dsd:if>
  
</dsd:dsd>


