Here’s a couple of simple enhancements that I would find very very useful, and I’m wondering if anybody else would.

 

Request #1: I wish the foreach task could loop over a nodeset extracted via an xpath query. Proposed syntax would be something like this:

 

<foreach item=”node” xpath=”/books/book/title” in=”books.xml” property=”myBookTitle”>

 

Most of the N-apps we typically use (nunit, ndocs, ncover) produce XML reports. I often want to examine those reports to decide whether or not to fail the build or to decide which direction to branch execution of the build script. But, right now, the only way (so far as I know) to iterate over all the nodes that match a particular xpath query is to use a style task to run an xsl transformation against the xml report to spit out a flat text file, and then iterate over the flat text file with a foreach task.

 

Request #2: I can see from the build output that the xmlpeek task knows how many nodes matched the specified xpath query, but I haven’t found anyway to get at that number in the build script. (For instance, I might want to know how many CriticalIssues there are in my FxCop report.) It’d be nice if the task would stick that number into a property.

 


Gary McCullough 

 

Reply via email to