I wondered why I hadn't got a response... It's because this didn't go to the list!
Forwarding so someone who knows can answer this.... Regards, Richard -----Original Message----- From: Foster, Richard - PAL Sent: Friday, November 11, 2005 15:37 To: 'Gary Feldman' Subject: RE: [Nant-users] Best way to merge contents of multiple XML files? Good point. I guess then what I really need to do then is get the count of sequencepoints, and sequencepoints which were hit then write that to another file (possibly using XmlPoke). In that case, does xmlpeek handle xpath expressions like "count(//coverage/module/method/[EMAIL PROTECTED] > 0])"? Regards, Richard -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gary Feldman Sent: Friday, November 11, 2005 14:08 To: nant-users@lists.sourceforge.net Subject: Re: [Nant-users] Best way to merge contents of multiple XML files? Foster, Richard - PAL wrote: > Hi there, > > I have a fairly large number of XML files (actually Ncover output > files) that I would like to merge into a single file. This will allow > me to produce coverage reports for a set of independently built > assemblies. > > What is the best way to accomplish this in Nant (or is it even > appropriate to use Nant - should I be "exec"ing something else)? > My experience has been that NCover output files can be huge, and that processing them with the NAnt <style> task can be very slow, depending upon what you're trying to do. Obviously you can just concatenate them all, stripping out the xml version and stylesheet lines, and wrap with your own new document element. In other words, something like cp myHeader.xml > outfile.xml grep -v "<?" Coverage.*.xml >> outfile.xml cp myFooter.xml >>outfile.xml where myHeader.xml contains the <?xml, <?xml-stylesheet, and <myTopLevelElement> and myFooter.xml would contain </myTopLevelElement>. This is probably doable in pure NAnt using the copy task with a filter, but it's faster and easier to use write with bash (at least for me). It assumes that the lines with <? don't contain anything else, so that it's safe to remove them on a line by line basis, which is much faster than doing xml parsing. But is that really what you want for the end result? My experience with large NCover files is that they're a pain to download in the browser, at least using one of the NCover style sheets off the net and Firefox. It may make much more sense to extract the summary data you want from all of the files, and then leave the raw data in separate files. That way anyone who wants to drill down into a specific module won't be dragged down by all the data from other modules. Gary ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Nant-users mailing list Nant-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_idv28&alloc_id845&op=click _______________________________________________ Nant-users mailing list Nant-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users