Basically, I want to create an XML file which describes all of the
changes that need to take place. For instance, consider the following
XML:

<updates>
  <update file="this.xml" xpath="/some/path/to/node" value="New value"
/>
  <update file="that.xml" xpath="/some/path/to/@attribute" value="Hello
World!" />
</updates> 

I think this is pretty straight-forward. I want to update a bunch of XML
files using an xpath query. I was hoping someone might have had to do
something like this before. It's fairly simple - I'm reading thru the
config file with an XmlTextReader and doing the updates using
XmlPokeTask. I also wanted to add an update type (i.e. replace, prepend,
or append); but I don't really need that right now, so it's not a big
deal - that was just me being forward-looking and all :-P

Like I said, it's not that it's difficult; I just wanted to see if
anyone else has done it before and/or I'm missing out on a feature of
Nant. I know I could create a lot of xmlpoke statements, but I wanted to
allow other people to manage the list without screwing around with the
build script. This way, all the updates are in one place with nothing
else to complicate it.

Michael

-----Original Message-----
From: Gary Feldman [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 23, 2005 11:07 AM
To: Flanakin Michael C Ctr HQ OSSG/OMR
Cc: nant-users@lists.sourceforge.net
Subject: Re: [Nant-users] Mass XML Updates

Flanakin Michael C Ctr HQ OSSG/OMR wrote:

>Yeah, I know how to code it. I was just wondering if anyone has already

>attacked the problem so I wouldn't have to. The best programmer is a 
>lazy programmer! :-) ...ok, maybe not; but I can try.
>  
>
What exactly is the problem?  I know you don't expect to take someone
else's custom code that finds their files and makes their changes to
just work with your files and your changes.  And you haven't given
enough detail to know what a general purpose solution might be.  It
might be as simple as walking through a fileset with a foreach, using
xmlpeek and xmlpoke to make the changes, or something intermediate using
XSLT, or your own custom program.

Gary

>-----Original Message-----
>From: Martin Gainty [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 23, 2005 8:28 AM
>To: Flanakin Michael C Ctr HQ OSSG/OMR
>Cc: nant-users@lists.sourceforge.net
>Subject: RE: [Nant-users] Mass XML Updates
>
>Good Morning Michael
>
>I would look at XMLDOcument and XMLTextReader facilities available with

>.NET classes at
>
>http://support.microsoft.com/default.aspx?scid=kb;en-us;317662
>
>HTH,
>
>Martin Gainty
>
>(mobile) 617-852-7822
>
>
>
>
>
>  
>
>>I have a number of XML files which need to be updated for my 
>>application. As more and more features need to be customized, I need 
>>to
>>    
>>
>
>  
>
>>update more and more XML files and properties. Obviously, I can manage

>>a build script to do all of these, but I'd honestly prefer not to do 
>>it
>>    
>>
>
>  
>
>>that way. Has anyone ran into something like this before? My first 
>>thought is to come up with an XML file that defines the properties to 
>>update; but if someone has already attacked this, I'd like to hear 
>>their solution.
>>
>>Michael Flanakin
>>
>>    
>>
>
>
>
>
>-------------------------------------------------------
>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
>
>
>  
>




-------------------------------------------------------
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

Reply via email to