Primarily two reasons: I plan on adding in prepend and append
capabilities and I want to be able to specify a root directory for every
task w/o using Nant properties which may make things harder to
understand for others. The people that will be updating this don't know
anything about Nant and I just want to make it as easy as possible for
them w/o risking breaking other parts of the build.

Honestly, I decided to just use xmlpoke for now. I know I'll need extra
features, but I'll deal with that when I get there. For now, it's just a
minor duplication of effort that I can live with.

Michael

-----Original Message-----
From: Gary Feldman [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 23, 2005 11:36 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:

>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>
>  
>
If you just change the word "update" to "xmlpoke", you'll have a valid
NAnt task.  Why isn't that good enough?

Gary

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




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