Wednesday, March 6, 2013

Parse XML from Google Drive Using Talend Open Studio

On this part we will see how we can load XML from Google Drive. I have below XML stored in my won Google Drive account, which is available for Download and view. So first of all please check you are able to download it. 

Required Things For Demo.
Sample XML (Download)
Talend Open Studio Installed

Here is our Sample XMl, you can Download it from above link. 



<?xml version="1.0" encoding="UTF-8"?>
<Itmes>
    <item id="111" clientName="SB">
        <details>
            <detail child_id="1">
                <name>Pen Drive</name>
                <amount>2</amount>
            </detail>
            <detail child_id="2">
                <name>Flash Drive</name>
                <amount>20</amount>
            </detail>
        </details>
        <tags>
            <tag tag_id="1">
                <name>CD</name>
            </tag>
        </tags>
    </item>
    <item id="112" clientName="GJ">
        <details>
            <detail child_id="1">
                <name>Flopy</name>
                <amount>1</amount>
            </detail>
        </details>
        <tags>
            <tag tag_id="1">
                <name>USB Drive</name>
            </tag>
            <tag tag_id="2">
                <name>USB 2.0</name>
            </tag>
        </tags>
    </item>
</Itmes>


  • Create a new job named as "XML_From_GDrive_2_CSV".
  • Create Metadata for above sample XML file using Metadata repository wizard see below screen. 
XML Metdata

  • Once you Created Schema/ Mapping then Drop the tFileInputXML from metadata you created in the Job and make it as Built in. 
  • Drop tFileFetch, tFileOutPutDelimited.
  • Configure tFileFetch property as below screen.
  • Set above XML download path in URI property.



  •  Now configure tFileInputXML with our Download Directory path with file name as below. 


  • Drop tFileOutPutDelimited and configure as mention in below picture.



  • Your final job will be look like this run the application and check for result it will be shown you result we can see here.




  • Output 




1 comment:

  1. nowaday (2014-12-16) the tFileFetch component doesn't succed in downloading the .xml file... Changed GoogleDrive policies I suppose...

    ReplyDelete

Contact Us

Name

Email *

Message *