Hi all,

 

Apologies, typically I found the answer shortly after asking the
question;

 

The solution was to call the svn element and run the process to set the
revisions, but also use <call>'s buffer and target properties to store
the current <svn> node and run another Ant target to calls the buffer
rather than the original list.  

 

The result of running the below on my original xml would be;

 

[echo] svn://localhost/repo1

[echo] api

[echo] svn://localhost/repo2

[echo] site1

[echo] site2

 

<xmltask source="mylist.xml">

<call path="projects/svn" target="process-projects" buffer="abc">

            <param name="repo" path="../@repository" default="n/a"/>

            <actions>

                  <echo>@repo</echo>

          </actions> 

      </call> 

</xmltask>

 

<target name="process-projects">

 

<xmltask sourcebuffer="mylist">

<call path="/svn/project">

            <param name="repo" path="../@repository" default="n/a"/>

            <param name="project" path="@name" default="n/a"/>

            <param name="extension" path="../@extension" default=""/>

            <actions>

                  <echo>@name</echo>

          </actions> 

      </call> 

</xmltask>

</target>

 

 

Regards,

Phil Jeary

 

 

 

From: Phil Jeary 
Sent: 11 January 2011 13:14
To: 'xmltask-users@lists.sourceforge.net'
Subject: Running tasks on elements and nested elements.

 

Hi all,

 

In short - I'm trying to open an xml document and run a task on an
element and then further tasks on its sub-elements.

 

Full explanation;

 

I'm trying to generate SVN logs using details stored in an XML file.
Using the example below, the api code for the project is in 1
repository, the front ends for the project are in another repository.
I've only put 2 in the example but there's over 50 in the proper list.

 

Example of file;

 

<projects>

<svn repository="svn://localhost/repo1" extension=".xml">

      <project name="api"/>

</svn>

<svn repository="svn://localhost/repo2" extension=".xml">

      <project name="site1"/>

      <project name="site2"/>

</svn>      

</projects>

 

This was my original code to produce the SVN log;

 

<xmltask source="mylist.xml">

<call path="projects/svn/project">

            <param name="repo" path="../@repository" default="n/a"/>

            <param name="project" path="@name" default="n/a"/>

            <param name="extension" path="../@extension" default=""/>

            <actions>

                  <echo>svn log --xml -v @{repo}/@{project}/${codeline}
-r${current.tag.rev}:${comparison.tag.rev} > @{proje...@{extension}
</echo>

          </actions> 

      </call> 

</xmltask>

 

I had a separate process to get the revisions used to get the log,
however, I realised they need to be different per svn.  I though maybe I
could use another <Call> in the first calls actions (see below), but
that didn't work.

 

<xmltask source mylist.xml ">

      <call path="projects/svn">

            <param name="repo" path="@repository" default="n/a"/>

            <actions>

                  <ant antfile="log.xml" target ="get-revisions"/>

                  <call path="projects/svn/project">

                        <param name="project" path="@name"
default="n/a"/>

                        <actions>

<echo>svn log --xml -v @{repo}/@{project}/${codeline}
-r${current.tag.rev}:${comparison.tag.rev} > @{proje...@{extension}
</echo>

                        </actions>

                  </call> 

            </actions>

      </call> 

</xmltask>

 

Any idea how I could open mylist.xml, run a task on the each of the
<svn> elements and a nested task on the <project> elements within each
<svn> element?

 

Any help would be much appreciated.

 

Kind Regards,

Phil Jeary

 


______________________________________________________________________

This email (and any attachments) is confidential and may contain
personal opinions which are not the views of Dovetail Services (UK)
Limited unless specifically stated.  If you have received it in error,
please delete it from your system.  Do not use, copy or disclose the
information in any way nor act in reliance on it and notify the sender
immediately.  Please note that:  * Dovetail Services (UK) Limited
monitors all emails sent or received, any further communication will
signify your consent to this.

Dovetail Services (UK) Ltd Registered in England and Wales Number 5412224
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

Reply via email to