Thanks for the explanation; reading the code doesn't really instill all
the background thinking. I will change my code accordingly.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Ian
MacLean
Sent: Monday, April 15, 2002 7:17 PM
To: Scott Hernandez
Cc: [EMAIL PROTECTED]
Subject: Re: [nant-dev] ElementNameAttribute and BuildElementAttribute

Scott Hernandez wrote:

> I don?t know much about the development history so this may be a dumb 
> question.
>
> Is there a reason that BuildElementAttribute isn?t derived from 
> ElementNameAttribute.
>
Yes. they are performing different tasks. ElementNameAttribute is used 
to associate an xml element name with a particular class thats being 
used to model that element. BuildElementAttribute indicates that the 
current property models a child element in the build file and gives the 
name of that element. When NAnt starts up it scans all relevent 
assemblies for classes with ElementNameAttribute 's and essentially 
builds a lookup table mapping element name to class. Then when 
tasks/elements are being loaded from the build file the 
BuildElementAttributes are used to know what child elements to select 
from the build file ( using xpath ).

If you look thru the source you'll see that this isn't *quite* true - on

startup it looks for TaskNameAttribute's not ElementNameAttribute 's - 
thats because I haven't finished generalising all that code. Now that 
you remind me I should get that done pretty soon.

you'll notice also that ElementNameAttribute is only relevant on class 
declarations while BuildElementAttribute applies to Property 
declarations. Having one derive from the other really wouldn't make much

sense.

I hope this clarifies things

Ian

> It seems like they both define named Element nodes, the former being 
> handled in a more specialized way in the Element InitializeAttributes 
> method.
>
> Thanks,
>
> Scott
>
> PS. I tried looking in the archives, but found sourceforge?s archive 
> viewer horrible. I have since subscribed this list on 
> www.mail-archive.com <http://www.mail-archive.com/> . This is 
> searchable? 
> http://www.mail-archive.com/nant-developers%40lists.sourceforge.net
>




_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers


_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to