Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Ignore xml parse exceptions [SOLVED]

Hi all,
I want to extract datas from xml files generated by differents applications.
To do this, I use a tFileList component to parse a directory containing my xml files and some tFileInputXml component to parse files.
When a xml file isn't correct a SAXParse exception happen and my job is stopped. Is it possible to continue the job, stop the parse of incorrect file but continue parsing others files?
thx all
Labels (3)
5 Replies
Anonymous
Not applicable
Author

Hello
Is it possible to continue the job, stop the parse of incorrect file but continue parsing others files?

No, it is impossible at the moment. 0683p000009MPcz.png tFileInputXML don't ignore the error when it meet a exception
Best regards

shong
Anonymous
Not applicable
Author

Thank you for the response. 0683p000009MPcz.png
Do you think it's possible to run a tjava component wich delete my corrupted xml file and restart my job?
This tjava component will be start with an "on Error" trigger..
Anonymous
Not applicable
Author

U can first use a tJava to check all xml files and catch the exception, then use talend as usual for the validated files.
Anonymous
Not applicable
Author

Why not! But use a tJava component to check xml files before re-parse some of them isn't very sexy.
Anonymous
Not applicable
Author

I found another solution : (not great but a solution)
I have a main job (job A) which parses all xml files in a directory then remove them (on by one).
When an exception occured in job A because of an incorrect xml file I jump to another job (job B) with an "on error from component" transition.
The job A is stopped by the SAX exception.
The job B move my wrong xml file in another directory (send a mail, etc....) then restart job A.
And finally all xml files are parsed or saved and exception are send by mail.
Thx all... I turn post to solved.