Ken,

Yes, I do this all the time with <xmllist>.  I made a slight 
modification that I use a lot, but your particular case doesn't need my 
mod.  Look at 
http://weblogs.asp.net/soever/archive/2006/12/01/nant-xmllist-command-updated.aspx.
  
This is a blog entry, but it has a link to the code you want.
> Message: 4
> Date: Tue, 27 Jan 2009 11:53:26 -0500
> From: "Parrish, Ken" <kparr...@gomez.com>
> Subject: [NAnt-users] Navigating XML documents ...
> To: <nant-users@lists.sourceforge.net>
> Message-ID:
>       <6d3ca9b0bea31640b4e6338360c84740041c0...@entdc1ms02.corp.gomez.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Sometime back there were several postings regarding the problem of
> navigating through a collection of XML nodes in an XML document.
>  
> I have a Nant task that needs to fetch a collection of XML nodes from a
> file and iterate over the collection and take action against each node.
> An example of the content of the XML file is shown below.
>  
> In this case, I need to fetch the <FileItems> node and iterate over this
> child nodes.  I am aware that the <xmlpeek> task has a node number that
> can be use to fetch the nth node in a list.  However, my files
> potentially have 100's of nodes to this technique seems pretty
> cumbersome.
>  
> I recall seeing a reference to an <xmllist> task, but my link to this
> task is broken.
>  
> Are there any reasonable solutions to this problem?  Any Nant libraries
> for parsing and navigating XML files?
>  
> <?xml version="1.0"?>
> <MyFileList>
>       <summary>
>       </summary>
>       <FileItems>
>             <FileItem Path="file01.txt" />
>             <FileItem Path="file02.txt" />
>             <FileItem Path="file03.txt" />
>             <FileItem Path="file04.txt" />
>             <FileItem Path="file05.txt" />
>       </FileItems>
> </MyFileList>
>
>
> Thank you,
>  
> Ken Parrish
> Gomez, Inc.
>   

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to