# XML Node not found (msbuild file)

**URL:** https://www.finalbuilder.com/forums/t/xml-node-not-found-msbuild-file/6173
**Category:** Discussion
**Tags:** xml, xpath
**Created:** [September 13, 2018, 10:59pm UTC](https://www.finalbuilder.com/forums/t/xml-node-not-found-msbuild-file/6173 "2018-09-13T22:59:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pete](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.finalbuilder.com/forums/u/pete)
#### Post date: [September 13, 2018, 10:59pm UTC](https://www.finalbuilder.com/forums/t/xml-node-not-found-msbuild-file/6173/1 "2018-09-13T22:59:54Z")

</div>

I’m attempting to access version information from a .dproj (msbuild) xml document. I’m able to do it in Notepad++ and in my own Delphi (MSXML) code. In Finalbuilder it reports “Node not found”.  
I have escaped the “$(” as “$$(” in FinalBuilder.  
I’ve got a simple 3 line project if you’d like to take a look.

Here is my XPath:  
`/Project/PropertyGroup[@Condition = "'$(Base)'!=''"]/VerInfo_MajorVer`

Here is the source XML (stripped down for easy reading):  
`<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Condition="$(Base)'!=''"> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <VerInfo_MajorVer>4</VerInfo_MajorVer> <VerInfo_MinorVer>1</VerInfo_MinorVer> <VerInfo_Release>1</VerInfo_Release> <VerInfo_Build>1</VerInfo_Build> <VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion> <VerInfo_Locale>1033</VerInfo_Locale> </PropertyGroup> </Project>`

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [September 13, 2018, 11:28pm UTC](https://www.finalbuilder.com/forums/t/xml-node-not-found-msbuild-file/6173/2 "2018-09-13T23:28:40Z")

</div>

Hi Pete

I suspect this has to do with xml namespaces.

See this blog post

[https://www.finalbuilder.com/resources/blogs/xml-actions-and-the-xpath-returned-no-node-error2](https://www.finalbuilder.com/resources/blogs/xml-actions-and-the-xpath-returned-no-node-error2)

This is just how MSXML works. The Project node has a namespace, so you need to prefix it

```auto
/x:Project/x:PropertyGroup[@Condition = "'$(Base)'!=''"]/x:VerInfo_MajorVer

```

---

<div class="post-metadata">

### Author: ![pete](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pete](https://www.finalbuilder.com/forums/u/pete)
#### Post date: [September 14, 2018, 12:16am UTC](https://www.finalbuilder.com/forums/t/xml-node-not-found-msbuild-file/6173/3 "2018-09-14T00:16:31Z")

</div>

Hi Vincent - Thanks for the fast response. It’s nice dealing with folks in AU and NZ because I post in the evening and I always have a response in the morning 🙂 Today was even faster.

So - you are correct that I needed a namespace prefix. I’d tried a few possibilities, but none had worked. Based on the article you sent, I tried again. Still no joy. However, I think I have identified, if not fixed, the problem. I changed the XML node that I was looking for from:  
`<PropertyGroup Condition="$(Base)'!=''">`  
to  
`<PropertyGroup Condition="Simple">`  
And it worked.  
So, I think it may have to do with quote nesting and/or escaping. That was a challenge I dealt with in my Delphi app too.  
Any chance you could give this a try? I’ve updated the test project to have a working and a failing section. (still just a few lines long) I can email it if you’d like.  
If there isn’t an existing solution, I’ll try to figure out how to create my own actions in this new version. It’s been a while.  
Thanks! [XPathTest.fbx8](https://www.finalbuilder.com/forums/uploads/default/original/1X/3588dbdde395f77125b3822d6dc8e2f9907c262c.fbx8) (8.2 KB)

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [September 14, 2018, 12:29am UTC](https://www.finalbuilder.com/forums/t/xml-node-not-found-msbuild-file/6173/4 "2018-09-14T00:29:50Z")

</div>

There’s a mistake in the document,

```
 <PropertyGroup Condition="$$(Base)'!=''">

```

should be

```
 <PropertyGroup Condition="'$$(Base)'!=''">

```

When I tested this with a dproj file on my system (one of FinalBuilder’s) it worked first time

Working project attached (I literally just add a single ’ and it worked.

[XPathTest.fbx8](https://www.finalbuilder.com/forums/uploads/default/original/1X/35c7da784c3c3a4c68caabea33192f1596125cdb.fbx8) (8.2 KB)
