ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Reserved words of XML-Tags in AntBuildFiles
Date Thu, 08 Feb 2001 12:23:47 GMT
Christoph Wilhelms <> wrote:

> Greetings!
>> There is no way to define a "context" in a DTD - an element
>> "project" is a "project" element and its attribute list is defined
>> exactly once.  I'm not sure whether one can define a
>> context-sensitive attribute list in XSchema.
> I do not now much about DTDs :-(, but isn't there a context because
> tags are nested in other tags?


You say there is an element named project, that may contain either a
target, taskdef or property element by (omitting data types for

<!ELEMENT project (target | property | taskdef)*>

This doesn't say anything about the parent element of project. If you
have a task that contains a project child element, this DTD would
allow you to nest targets into them.

Likewise you define the attributes for project (name, default and
basedir attribute) without any reference to a context:

<!ATTLIST project
          name    CDATA #REQUIRED
          default CDATA #REQUIRED
          basedir CDATA #IMPLIED>

So you cannot have a <project> tag with any other attribute than these
three - no matter where you put it.

> Wich tags should be reserved? Only <project> and <target>?

Right now we have elements for project, target, all defined tasks, all
defined datatypes and all nested elements they know of.

Don't confuse "elements" with "attributes". You can have "name"
attributes in several elements meaning totally different things for

That we should use the same names for attributes that have the same
meaning and different attribute-names for things that do different
things is a separate issue 8-)


View raw message