ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Project.toXML() ?
Date Mon, 14 Oct 2002 15:36:41 GMT
I'm amazed how a DOM-based ProjectHelper always gets dismissed when it's
clearly the ideal solution to provide serialization back to XML from the
original XML (among other things):

1) It keeps all the info needed,
2) It's standard and well documented, whereas UnknownElement /
RuntimeConfigurable, which emulates it basically (with added stuff granted),
is not,
3) It allows total separation of the parsing from the instantiation of the
model,
4) It would speed up <antcall> but not having to re-parse, and save memory
too by keeping around the DOM tree (if <antcall> element are detected for
example),
5) It would allow programmatic XSL hooks to would feed the transformed
document (in memory DOM tree) directly to Ant. This feature alone would be
fantastic!!!
6) It would allow a clean, at parse-time import/include model, similar to
XSL.

Finally, I'd say it that it would also allow something I've wished for for
some time now... The ability to externally change a build file attribute
*without* requiring to go thru a property. Something like:

ant -D//javac/@debug=true build

which would after parse-time, but before instantiation of the model, scan
the DOM tree of the build file, and using the provided XPath expression,
assign the attribute override provided. That would reduce the need for
properties tremendously. In this particular example, all explicit debug
attributes of all the <javac> tasks (hard-coded to either true or false) get
changed to true auto-magically... --DD

-----Original Message-----
From: Costin Manolache [mailto:cmanolache@yahoo.com] 
Sent: Sunday, October 13, 2002 5:26 PM
To: ant-dev@jakarta.apache.org
Subject: Re: Project.toXML() ?

Another aproach that would also preserve the comments is to use a 
ProjectHelper that is based on DOM.

I'm not sure why would you want that - since you could just read
the original document. It is only interesting when you create the
Project at runtime, using API calls, or when you use some tool to
dynamically change the project ( edit properties, etc ).

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message