ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Vogel <>
Subject Extensible Attributes
Date Thu, 14 Dec 2000 01:32:24 GMT
Hi all,
A fairly common thing in large development projects is the idea that there
are certain people who "own" a section of the code, any build problems in
that code should be brought to the attention of that owner/those owners.
When I've solved this in the past, with a non-ant driven build, I've parsed
output of gnumake and had an associative array (PERL) I slurp in on the side
indicate who "owns" or should be notified about various directories within
the tree.
I was about to do the same thing today with an ant-based (but still PERL
at the top) build, when I thought:  "Wait!  This is XML, we'll maintain the
owner info
in the same place as the rest of the build!" so I proceeded to add an
"owner" attribute
to targets, and my perl script uses XML::Parser to snag that information
from build.xml
before calling ant and parsing its output.
Cool!  Except for some reason, which this XML neophyte does not understand,
ANT is
very strict about the attributes that it will allow on the tags it handles.
So I went and 
hacked to have it recognize and ignore the "owner"
attribute in 
TargetHandler's init interface.
So, I have two primary questions:
1.  Why be so strict about attributes on tags, such that you throw an
exception for 
     any unrecognized tag?  Why not just silently ignore (or warn, if you
must) unrecognized
     tags?  Isn't that the whole point of XML?, to allow disparate tools to
communicate more
     efficiently?  Isn't it the case that some tools will look at some
tags/attributes and not
     others and vice versa?  If anyone else agrees, perhaps the
            }else { throw SAXParseException("unknown attribute ..."); } 
     should be eliminated from
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 */
Manager, Configuration Management
Arsin Corporation
4800 Great America Parkway, Suite 425
Santa Clara, CA 95054

View raw message