ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Extensible Attributes
Date Thu, 14 Dec 2000 08:44:20 GMT
Peter Vogel <> wrote:

> 1.  Why be so strict about attributes on tags, such that you throw
> an exception for any unrecognized tag?

Because Ant doesn't expect to see anything that has meaning to
something else but not Ant in a build file. We had a similar
discussion a while back when we talked about adding documentation to
build files.

The solution to this problem would be to use namespaces IMHO. Ant
doesn't handle namespaces ATM but as Ant2 will use SAX2 we could make
Ant ignore everything that's not in its namespace. So you'd define
your owner attribute in a namespace owners and make that

<target name="main" owners:owner="fred">

No short term solution though.

> 2.  If there *is* a good reason (and remember, I'm an XML neophyte,
> so what do I know?) for this stringency, can we add the following
> code to TargetHandler::init?:
>         } else if {key.equals("owner")) {
>             /* ignore me */
>         ...

You mean with the opening brace before key translated to a paren?

Don't think so, sorry. If we'd start this, we'd be adding exceptions
for anybody else as well.


View raw message