Bah formatting got messed up in my last email, sorry about that. Mark Coffin mcof...@aalsolutions.com Phone: 905.632.0864 1.800.668.8486 Fax: 905.632.2605 www.aalsolutions.com
-----Original Message----- From: Mark Coffin Sent: April 16, 2009 9:49 AM To: 'Cool The Breezer'; Xmltask-users@lists.sourceforge.net Subject: RE: [Xmltask-users] Insert task You can do it like this: You can't access properties directly, so you pass them in as parameters to the task. Then in the task you access the parameter like ${paramName}. In your database.properties you have something similar to this --------- database.properties -------------- docbase=value dburl=jdbc:oracle:thin:@db_address:db_port:db_sid username=myuser password=secret -------------------------------------------- Ant build file... <loadproperties srcFile="database.properties" /> <antcall target="deploy_local"> <param name="docbase" value="${docbase}" /> <param name="dburl" value="${dburl}" /> <param name="username" value="${username}" /> <param name="password" value="${password}" /> </antcall> <!-- Deploys to local server --> <target name="deploy_local"> <echo message="${tomcat.home}"/> <xmltask source="${tomcat.home}/conf/server.xml" dest="${tomcat.home}/conf/1.xml" report="true"> <insert path="/Server/Service/Engine/Host/text()[1]" position="before"> <![CDATA[ <Context path="/doceng" reloadable="true" docBase="${docbase}"> <Resource name="jdbc/docengdb" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="${dburl}" username="${username}" password="${password}" maxActive="20" maxIdle="10" maxWait="-1"/> </Context> ]]> </insert> </xmltask> </target> Hope this helps. Mark Coffin mcof...@aalsolutions.com Phone: 905.632.0864 1.800.668.8486 Fax: 905.632.2605 www.aalsolutions.com -----Original Message----- From: Cool The Breezer [mailto:techcool.ku...@yahoo.com] Sent: April 16, 2009 7:57 AM To: Xmltask-users@lists.sourceforge.net Subject: [Xmltask-users] Insert task Hi, Thanks Brian for your help to my earlier mail in ant user list. I want some advanced stuff on replacing dynamic text with literals while inserting to target tag in xml. E.g. <!-- Deploys to local server --> <target name="deploy_local"> <echo message="${tomcat.home}"/> <xmltask source="${tomcat.home}/conf/server.xml" dest="${tomcat.home}/conf/1.xml" report="true"> <insert path="/Server/Service/Engine/Host/text()[1]" position="before"> <![CDATA[ <Context path="/doceng" reloadable="true" docBase="@docbase"> <Resource name="jdbc/docengdb" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="@dburl" username="@username" password="@password" maxActive="20" maxIdle="10" maxWait="-1"/> </Context> ]]> </insert> </xmltask> </target> I want to replace @docbase,@dburl,@username etc... with actual value from property file before inserting into target XML. Please suggest me how to do it. - RB ------------------------------------------------------------------------ ------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Xmltask-users mailing list Xmltask-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xmltask-users ****** CONFIDENTIALITY NOTICE ****** NOTICE: This e-mail message and all attachments transmitted with it may contain legally privileged and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message from your system. Thank you. ------------------------------------------------------------------------------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Xmltask-users mailing list Xmltask-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xmltask-users