Skip to main content Skip to complementary content
Close announcements banner

Procedure

Procedure

  1. Drop the following components from the Palette onto the design workspace: tMysqlInput, tExtractXMLField, and tFileOutputDelimited.
    Connect the three components using Main links.
  2. Double-click tMysqlInput to display its Basic settings view and define its properties.
  3. If you have already stored the input schema in the Repository tree view, select Repository first from the Property Type list and then from the Schema list to display the Repository Content dialog box where you can select the relevant metadata.
    For more information about storing schema metadata in the Repository tree view, Managing metadata in Talend Studio.
    If you have not stored the input schema locally, select Built-in in the Property Type and Schema fields and enter the database connection and the data structure information manually. For more information about tMysqlInput properties, see tMysqlInput.
  4. In the Table Name field, enter the name of the table holding the XML data, customerdetails in this example.
    Click Guess Query to display the query corresponding to your schema.
  5. Double-click tExtractXMLField to display its Basic settings view and define its properties.
  6. Click Sync columns to retrieve the schema from the preceding component. You can click the [...] button next to Edit schema to view/modify the schema.
    The Column field in the Mapping table will be automatically populated with the defined schema.
  7. In the Xml field list, select the column from which you want to extract the XML data. In this example, the field holding the XML data is called CustomerDetails.
    In the Loop XPath query field, enter the node of the XML tree on which to loop to retrieve data.
    In the Xpath query column, enter between inverted commas the node of the XML field holding the data you want to extract, CustomerName in this example.
  8. Double-click tFileOutputDelimited to display its Basic settings view and define its properties.
  9. In the File Name field, define or browse to the path of the output file you want to write the extracted data in.
    Click Sync columns to retrieve the schema from the preceding component. If needed, click the [...] button next to Edit schema to view the schema.
  10. Save your Job and click F6 to execute it.

Results

tExtractXMLField read and extracted the clients names under the node CustomerName of the CustomerDetails field of the defined database table.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!