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> -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Loren Halvorson Sent: Sunday, December 11, 2005 12:32 PM To: nant-users@lists.sourceforge.net Subject: RE: [NAnt-users] XMLPoke: What to do when file or element doesn't exist? You can maybe use the <echo> task for creating an xml file <echo file="foo.xml"> <![CDATA[ <settings> </settings> ]]> </echo> -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Williams Sent: Saturday, December 10, 2005 6:57 PM To: nant-users@lists.sourceforge.net Subject: [NAnt-users] XMLPoke: What to do when file or element doesn't exist? I am working on a project where I am using a utility called XMLPreprocess which needs a input file in a format of /settings/properties/@name. I would want to create this file at build time driven off of a nant.include file (I have that part done already). I was wondering what other people are doing for creating a xml file with NAnt. A file that does not exist before the NAnt script starts, one that NAnt creates with some task. I was looking at making a change to XMLPoke with an boolean switch to tell it to create the file if it doesn't exist and to also enter an element and/or attribute if they don't exist either. I have found other situtations, outside of my little XMLPreprocess issue where this would be really usful. Just looking for suggestions before spending too much time on this. Maybe someone has already built this already? If not, does anyone else think that this would be a nice to have that maybe NAnt should "just have" for us? Eric ------------------------------------------------------- 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 ------------------------------------------------------- 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 ------------------------------------------------------- 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