XML iterator failing if nothing found

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

Hi Raoul,

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

.t8

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


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

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,


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.

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

Regards,

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

Regards,
Paul.