FB 6.0.0.674: XML Node Iterator (issue)

Hi,

Note: title should read 6.0.0.574

When a XML Node iterator doesn't return any nodes from the xml document, FB4 used to return an Action.IterationCount < 1, FB6 returns an Action.IterationCount = 1 while no nodes are found. I understand that the Action iterated once, hence the Action.IterationCount = 1, but it breaks my project ;(.

The issue at hand here is that if no nodes are returned from the XML document sertain attributes should be reset, so a list is processed again.

How can I determine when I need to reset attributes in a XML document?

Regards Alfred

Hi Alfred

I know that Angus made several changes to the Iterator action classes for FB6 to make them behave better in try/catch blocks. It may be that what you are seeing is an unintended side effect. We will look into this and get back to you.

 

 

Hi Alfred,

Thanks for your post. Sorry to hear you're having problems. I have some more comments to add.

- First off, I'm not actually able to reproduce this... the AfterAction event for my XML Node Iterator returns Action.IterationCount == 0. It's the same regardless of whether the actions are wrapped with Try/Catch or not. Perhaps I need to add something else in order to reproduce this?

- Second of all, I have some suggestiosn for possible ways you may be able to restructure the process:

1) Use the "Fail If No Nodes are found" option on the iterator action, with a Try/Catch block or a "If Prev Action Failed" action. If you use an "XML Document Load" action to read the XML document, you will be able to separate possible load errors (ie badly formed XML or file not found) from errors due to nodes not found.

2) Use a separate "Read XML Value to Variable" action in a Try/Catch block, to determine if at least one node exists.

3) Set the default values for variables anyway, and then use the node iterator to change them if nodes are found (I realise this may not suit your situation.)


Please let us know if any of this is of assistance, or if there's any more information I can use to reproduce the problem.

Regards,

Angus