Questions tagged [xmlpoke]

Xml poke is a tool to make some pokes in xml files with msbuild.

Xml poke is a tool to make some pokes in xml files with msbuild.

19 questions
15
votes
2 answers

How can I use Nant's xmlpoke target to remove a node

Given the following xml: Content A Content A Using XMLPoke with the following XPath: rootnode/childnode[arg='b'] The result (if the replace string is empty)…
Iain
  • 10,433
  • 16
  • 56
  • 62
9
votes
1 answer

XmlPoke task trims value

Is there a way to use value ending with space as XmlPoke value? When I execute task, value is replaced but without space at the end. Reproduction: test.targets:
Filip
  • 3,257
  • 2
  • 22
  • 38
5
votes
2 answers

Add attribute to an xml node with nant

Is there a way to add an attribute to an xml node (which I have the xpath of) using nant? Tried xmlpoke but it looks like it can only update existing attributes. thanks.
Meidan Alon
  • 3,074
  • 7
  • 45
  • 63
5
votes
2 answers

xmlpoke in Nant - how to update all instances of found string

Hi I am using Xpath in my Nant build script to change some config variables between development and my other environments. I have taken the syntax from this example: The example looks like this:
Remotec
  • 10,304
  • 25
  • 105
  • 147
5
votes
1 answer

XmlPoke and unique nodes

I am trying to use an xmlpoke task to update a VS Project File (which is XML). In the Project root, there are multiple PropertyGroup nodes, I am trying to select the first one. The XML looks like this
Lou Franco
  • 87,846
  • 14
  • 132
  • 192
4
votes
1 answer

Using CakeBuild XMLPoke change inner text value of node

I'm having trouble figuring out how I can change the inner text value of an XML node using XmlPoke in Cake. The error I keep getting is Error: Expression must evaluate to a node-set. My XML looks like this
Stephen Gilboy
  • 5,572
  • 2
  • 30
  • 36
4
votes
4 answers

How can I use MSBuild 'afterbuild' tasks to edit a .config file?

I have a .config in a target project and I need to add a line to it programmatically via an MSBuild task. Pseduo operations like: find target .config file determine the value of attributes for new node (e.g. 'id' and 'version' for 'package'…
JTech
  • 3,420
  • 7
  • 44
  • 51
3
votes
3 answers

What is the right way to update android manifest with xbuild and Jenkins

In our environment we are building xamarin.android project and would like to pass $(build_number) variable to Jenkins build. Unfortunately Jenkins is building the project as if nothing was passed to the build workflow. I tried to use XmlPoke which…
Mando
  • 11,414
  • 17
  • 86
  • 167
2
votes
1 answer

problems with xmlpoke in nant script when reading a semicolon in a string

I have a nant script that is trying to change a URL value in my web.config but Nant keeps throwing this error: '=' is an unexpected token. The expected token is ';'. Line 1, position 80. I traced it down to the semicolon in the URL of the nant…
goku_da_master
  • 4,257
  • 1
  • 41
  • 43
2
votes
2 answers

namespaces and specific xpath

Can anyone tell me how can I get the xpath of the name attribute from this file: I'm trying to get it for nant xmlpoke task…
Meidan Alon
  • 3,074
  • 7
  • 45
  • 63
2
votes
1 answer

Change nhibernate config with nant xmlpoke

How can I change the connection string from nhibernate.config file using nant the problem is that all examples are about changing attribute value, but nhibernate has inner text eq:
isuruceanu
  • 1,157
  • 5
  • 23
2
votes
1 answer

grunt updating options in one task so subsequent tasks can use them

I need to run grunt-bump which bumps the version number in the package.json, then run grunt-xmlpoke and update a config file with new version number. So I have tried a couple of things. Inside the grunt.initConfig I run bump, then I run xmlpoke. 1)…
Raif
  • 8,641
  • 13
  • 45
  • 56
1
vote
1 answer

Xmlpoke to add multiple appsettings key doesn't work

I have a Msbuild target that gets executed successfully by adding a single key called 'ProjectID' to the appsetting section of web.config. Now am changing the behavior of this target by adding one more key 'ApplicationId' to the same appsetting…
theandroid
  • 809
  • 1
  • 6
  • 13
1
vote
1 answer

Alternatives to calling XMLPoke over and over for build configurations (MSBuild or NANT)?

Is there an efficient way to build out large configs (many properties that need to be set) for .NET Projects? XMLPoke is great for a small number of changes, but it doesn't scale well for large more complex projects with many properties to set. Here…
Ray
  • 1,422
  • 2
  • 21
  • 39
1
vote
1 answer

MSBUILD: How to append to XML file

For ou application we use a XML File which is generated during build process (at the moment with NAnt). In the XML file is for each application Module a section. Now I want to switch from NAnt to MSBuild. I want to append for each Module the Module…
Marko
  • 1,291
  • 1
  • 21
  • 37
1
2