Loren Halvorson wrote:

This is just an expansion on the idea of how you might use <echo> to
generate an XML File:


<project name="Test" default="GenerateSettings">

 <property name="setting.one" value="one"/>
 <property name="setting.two" value="two"/>

 <target name="GenerateSettings">
   <echo file="foo.xml"><![CDATA[<settings>]]></echo>
<echo file="foo.xml" append="true"><![CDATA[ <property
name="setting.one">${setting.one}</property>]]></echo>
   <echo file="foo.xml" append="true"><![CDATA[    <property
name="setting.two">${setting.two}</property>]]></echo>
<echo file="foo.xml" append="true"><![CDATA[</settings>]]></echo>
 </target>

</project>


Gak! That looks awful. You can't see where the nant XML stops and the content XML begins. You can't look at a specific </property> and tell whether it's closing a NAnt property element or something in the content. The bigger the target file, the worse it gets. And how do you find typos?

As I indicated in my other note, it's much cleaner to use a template file for the target XML.

Gary




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to