How to Read, Validate and Insert an XML data into Mysql DB in Talend
Hi, I will get an XML. I need to validate some fields of XML after that I need to Insert the data into DB. So please suggest me how to write the Talend Job for above operation.. Thanks in advance.
Hi, Please make sure your XML file is well-formed and then you can use talend component tFileInputXML to retrieve your attribution into relational table. For well-formed XML validation, here is a related article http://stackoverflow.com/questions/6362926/xml-syntax-validation-in-java, hope it will be useful for you.
Hi,
I am inserting the below XML using the job.
<root>
<Department>
<deptId>D1</deptId>
<deptName>Mech</deptName>
<deptHeadName>Ashok kumar</deptHeadName>
</Department>
<Person>
<id>P1</id>
<lastName>kumar</lastName>
<firstName>Arif</firstName>
<firstName>Shyam</firstName>
<deatils>
<name>hnlk1</name>
<value>1678</value>
</deatils>
<deatils>
<name>hnlk2</name>
<value>1878</value>
</deatils>
<deptId></deptId>
</Person>
</root>
I am using attached job to insert the XML. If I want to change the values of some fields before insertion, which component I need to use?