# How to select XML Node (with XPath)

**URL:** <https://www.finalbuilder.com/forums/t/how-to-select-xml-node-with-xpath/4603>\
**Category:** Discussion\
**Created:** [August 18, 2015, 2:15am UTC](https://www.finalbuilder.com/forums/t/how-to-select-xml-node-with-xpath/4603 "2015-08-18T02:15:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbauer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/85f322/32.png) [@rbauer](https://www.finalbuilder.com/forums/u/rbauer)\
**Post date:** [August 18, 2015, 2:15am UTC](https://www.finalbuilder.com/forums/t/how-to-select-xml-node-with-xpath/4603/1 "2015-08-18T02:15:03Z")

</div>

Hi,  
  
In an XML Document I want to set all occurrences of below node to “Value”  
  
\<verinfo\_majorver\>Value\</verinfo\_majorver\>   
(This is from the Delphi dproj file…)  
  
There are multiple occurrences in the document.  
  
What would be the correct XPath expression to select this node? (for use with an Edit XML File action.)  
  
(PS. I am using an older version of Automise.)  
  
Thanks  
Rael

---

<div class="post-metadata">

**Author:** ![rbauer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/85f322/32.png) [@rbauer](https://www.finalbuilder.com/forums/u/rbauer)\
**Post date:** [August 18, 2015, 2:19am UTC](https://www.finalbuilder.com/forums/t/how-to-select-xml-node-with-xpath/4603/2 "2015-08-18T02:19:48Z")

</div>

Sorry for once I didn’t preview.  
  
The node is

`<``VerInfo_MajorVer``> Value ``VerInfo_MajorVer``>`

  
(Hard to get the correct format in this editor, but you should get the idea! The node name is “VerInfo\_MajorVer”)

---

<div class="post-metadata">

**Author:** ![rbauer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/85f322/32.png) [@rbauer](https://www.finalbuilder.com/forums/u/rbauer)\
**Post date:** [August 18, 2015, 10:09am UTC](https://www.finalbuilder.com/forums/t/how-to-select-xml-node-with-xpath/4603/3 "2015-08-18T10:09:00Z")

</div>

I found this post which helps explain why standard XPath was not working for me:  
[https://www.finalbuilder.com/resources/blogs/postid/665/xml-actions-and-the-xpath-returned-no-node-error](https://www.finalbuilder.com/resources/blogs/postid/665/xml-actions-and-the-xpath-returned-no-node-error)  
  
It now works correctly with this XPath string:  
//x:VerInfo\_MinorVer  
  
However, I am still left with a problem. When using an “Edit XML File” action, it only applies the change to the first occurrence of the term. I expected it to apply to all occurrences in the document… (Using Automise 2)

---

<div class="post-metadata">

**Author:** ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)\
**Post date:** [August 19, 2015, 12:54pm UTC](https://www.finalbuilder.com/forums/t/how-to-select-xml-node-with-xpath/4603/4 "2015-08-19T12:54:53Z")

</div>

Hi Rael,   
  
 What is the behaviour your seeing with the latest build of Automise 4? You can find the latest builds located at [https://www.finalbuilder.com/downloads/automise](https://www.finalbuilder.com/downloads/automise)
