# XML iterator failing if nothing found

**URL:** https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741
**Category:** Feature Requests
**Created:** [October 5, 2006, 10:08am UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741 "2006-10-05T10:08:00Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![raoul](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/2acd7d/32.png) [@raoul](https://www.finalbuilder.com/forums/u/raoul)
#### Post date: [October 5, 2006, 10:08am UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741/1 "2006-10-05T10:08:00Z")

</div>

Hi,I got a piece of XML which I am trying to use with the XML iterator. But some tags are optional and the XML iterator is failing if it can not find a node. The reference tag in the example below might not be there. Is there anyway I can work round this? For now I have set ignore failure. Cheers

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [October 6, 2006, 1:52am UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741/2 "2006-10-06T01:52:00Z")

</div>

Hi Raoul,  
  
So what we really need is some kind of “XML Node/Attribute Exists” action, right?  
  
.t8

---

<div class="post-metadata">

### Author: ![raoul](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/2acd7d/32.png) [@raoul](https://www.finalbuilder.com/forums/u/raoul)
#### Post date: [October 6, 2006, 1:50am UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741/3 "2006-10-06T01:50:41Z")

</div>

I see the forum software erased my xml example… See attached picture.I think more of a node exist. Or a don’t fail if no nodes found on the iterator.Cheers,

![test.png](https://www.finalbuilder.com/forums/uploads/default/original/2X/c/c8ac90f661c36102540d687cfd7a41e0d93bb563.png)

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [October 9, 2006, 3:28am UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741/4 "2006-10-09T03:28:21Z")

</div>

so what’s the xpath statement you’re using. wouldn’t it be an error if there are no nodes found at all for the iterator?  
  
.t8

---

<div class="post-metadata">

### Author: ![raoul](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/2acd7d/32.png) [@raoul](https://www.finalbuilder.com/forums/u/raoul)
#### Post date: [October 9, 2006, 8:40am UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741/5 "2006-10-09T08:40:54Z")

</div>

For my mind it shouldn’t fall over if I use /websites/website[@name=’%sProjectName%’]/reference as the xpath while reference node does not exist or as mentioned above a node exist action.  
  
As said for now it works with ignore failure on the iterator which is fine by me, but I thought there must be a neater way of doing things.  
  
Cheers,

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [October 10, 2006, 1:19am UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741/6 "2006-10-10T01:19:41Z")

</div>

ok, thanks for that. I’ll put it on the todo list to allow the iterator to not fail if no nodes found.  
  
cheers,  
tate.

---

<div class="post-metadata">

### Author: ![fabienriaille](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/f/e9a140/32.png) [@fabienriaille](https://www.finalbuilder.com/forums/u/fabienriaille)
#### Post date: [June 24, 2009, 3:11am UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741/7 "2009-06-24T03:11:24Z")

</div>

Hello, any news about this function.   
 A checkbox “Do not fail if no match” is useful to manage optional attributes   
  
 Regards,

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [June 25, 2009, 12:59pm UTC](https://www.finalbuilder.com/forums/t/xml-iterator-failing-if-nothing-found/3741/8 "2009-06-25T12:59:37Z")

</div>

Hi Fabien,   
  
 The latest release of FinalBuilder has the ‘Fail if no nodes found’ option, you can download it from:   
  
 URL: [https://www.finalbuilder.com/downloads/finalbuilder/630/FB630\_1506.exe](https://www.finalbuilder.com/downloads/finalbuilder/630/FB630_1506.exe)   
  
 Regards,   
 Paul.
