xmlfile use

Nov 5, 2013 at 8:51 PM
I have xml files that our applications uses and in the past we have use xmlpoke in this format
Old poke code
<xmlpoke file="${ShellAppDir}\Providers\ClientConfiguration.xml" xpath="//ClientConfiguration[1]/Provider[1]" value="${Provider}" />
<xmlpoke file="${ShellAppDir}\Providers\ClientConfiguration.xml" xpath="//ClientConfiguration[1]/Edition[1]" value="${Edition}" />
Target file
<?xml version="1.0" encoding="utf-8"?>
<ClientConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Provider>provider_TOKEN</Provider>
<Edition>edition_TOKEN</Edition>
</ClientConfiguration>
We have since moved to TFS and are using the extension pack to try and replace the token values. My issue is that I am not able add elements/attributes in the same format meaning with this product, I am getting closing tags with <name/> instead of </name>. Ideas on how to do this with your product? I have tried update element and attribute with no luck.
Coordinator
Nov 29, 2013 at 9:47 AM
That looks like the nant task rather then the one provided by ms... Using the MSBuild Extension Pack you could use
<MSBuild.ExtensionPack.Xml.XmlFile TaskAction="UpdateElement" File="${ShellAppDir}\Providers\ClientConfiguration.xml" XPath="//ClientConfiguration[1]/Provider[1]" InnerText="${Provider}"/> 
<MSBuild.ExtensionPack.Xml.XmlFile TaskAction="UpdateElement" File="${ShellAppDir}\Providers\ClientConfiguration.xml" XPath="//ClientConfiguration[1]/Provider[1]" InnerText="${Edition}"/> 
Mike
Marked as answer by mikeFourie on 11/29/2013 at 2:48 AM