Hi,

I have a small query in xml task , my example is --

My source file from where i read the properties is like this -


My build-configuration
===================
<buildset>
<builds testname="testing">
  <testname>Category1</testname>
  <build>development</build>
  <build>systemtest</build>
  <build>production</build>
</builds>
<builds testname="test">
  <testname>Category2</testname>
  <build>DEV</build>
  <build>TEST</build>
  <build>PROD</build>
</builds>
</buildset>


My build.xml is ---
---------------------------
<?xml version="1.0"?>
<project name="java.net" default="main" basedir=".">
  <taskdef name="xmltask"
classname="com.oopsconsultancy.xmltask.ant.XmlTask">
 <classpath path="xmltask.classpath" />
</taskdef>

   <target name="main" depends="testprg"/>
    <property name="weblogic.home.cfgfile"
value="C:/bea/weblogic81/common/lib/workshopLogCfg.xml" />

   <target name="testprg">
       <xmltask source="build-configuration.xml">

         <call path="/buildset/builds/" target="roottest">
                <param name="name" path="testname/text()" />
                <param name="appender1" path="build[1]/text()" />
                <param name="appender2" path="build[2]/text()" />
                <param name="appender3" path="build[3]/text()" />
          </call>

           <call path="/buildset/builds/testname" target="roottest">
              <param name="name" path="text()" />
                  <param name="appenders"
path="/buildset/builds/build/text()" />
           </call>

          <call path="/buildset/buil...@testname]/build"
target="compile-and-release">
          <param name="build" path="text()"/>
          </call>
       </xmltask>
    </target>

 <target name="roottest" >
   <xmltask source="${weblogic.home.cfgfile}"
dest="${weblogic.home.cfgfile}" failWithoutMatch="true">

     <insert path="/log4j:configuration/root" position="after">
              <![CDATA[ <category name="${name}">
              <priority value="debug" />
              <appender-ref ref="${appenders}"
/>
              </category>
]]>
      </insert>
   </xmltask>
 </target>

When I run my build.xml file is run it adds all the properties from the
build-configuration xml to the workshopLogCfg.xml file, so far so good..
when I run the same build.xml file then it writes the data again.. ( no
change in the build-configuration .xml ) , instead i dont want the same data
to be re-written every time to workshopLogCfg.xml.

Is there a way to control this ? Something like -- <insert > only when
doesnt exist, else just update the same entries with the old entries...

Any idea will be so great...

thanks
adi
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

Reply via email to