Another XML question

Hello KNIMErs,

next question about XML processing :thinking:

My workflow has to read in hundreds of XML files. In another thread I had the question how to check which XML nodes exits or not and handle with it. Thanks again to @takbb for supporting me.

Now my workflow ist running but - bang - the XML Reader Node chrashs because the content of the XML file is corrupt. If I open th XML file e.g. with Notepad++ the content look like this.

Maybe you can guess my question :wink: How can I handle this error in my workflow while the workflow reads the XML file?

Thanks, Brotfahrer

1 Like

You could use the Try/Catch nodes to read in a series of files, and give you an idea of which ones are failing, while still keeping the data from the valid XMLs. Here’s an example workflow:

At least in this way the workflow won’t stop every time it runs into a malformed XML file. Of course then you still have to decide what you want to do with the broken XMLs… but maybe that is what you are really asking anyway?

2 Likes

Hi @ScottF ,

thanks for the example. My workflow is now running :smile: :+1:

Greetings, Brotfahrer

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.