I finally got around to seriously looking at adding referenceable elements to Nant, a topic that has been discussed several times on this list. I've done some prototyping, and it's looking pretty simple - which makes me think there's something that I don't understand. :) I thought I'd run my approach past people and see if I'm missing something.
The general approach is to add a hashtable of elements to the Project class. When an element is encountered that has an "id" attribute, it gets added to the hashtable. When sub-elements of an element are parsed, if the child XML node contains an idref attribute, the original element is looked up in the elements hashtable and the _xmlNode member of the original element is used to initialize the new element (in other words, it creates a whole new copy, it doesn't use the original element). I have a basic case working with a FileSet working. It seems pretty straighforward so far. I do need to think a bit more about what a reference to some other types of elements would mean, in case there's any semantic weirdness there. Anyone see any problems with this approach? BTW, so far I've only been thinking about a straight reference approach, not a "reference-and-extend" approach. That might be a nice feature, but could get more complicated. __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by: Jabber - The world's fastest growing real-time communications platform! Don't just IM. Build it in! http://www.jabber.com/osdn/xim _______________________________________________ Nant-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-developers
