Defining the schema - 7.1

Talend Big Data Studio User Guide

author
Talend Documentation Team
EnrichVersion
7.1
EnrichProdName
Talend Big Data
task
Design and Development
EnrichPlatform
Talend Studio

About this task

In this step, the schema parameters are set.

The schema definition window is composed of four views:

View

Description

Source Schema

Tree view of the XML file.

Target Schema

Extraction and iteration information.

Preview

Preview of the target schema, together with the input data of the selected columns displayed in the defined order.

Note: The preview functionality is not available if you loaded an XSD file.

File Viewer

Preview of the brute data.

First define an Xpath loop and the maximum number of times the loop can run. To do so:

Procedure

  1. Populate the XPath loop expression field with the absolute XPath expression for the node to be iterated upon. There are two ways to do this, either:
    • enter the absolute XPath expression for the node to be iterated upon (Enter the full expression or press Ctrl+Space to use the autocompletion list),

    • drop a node from the tree view under Source schema onto the Absolute XPath expression field.

      An orange arrow links the node to the corresponding expression.
    Note: The Xpath loop expression field is mandatory.
  2. In the Loop limit field, specify the maximum number of times the selected node can be iterated, or -1 if you want to run it against all of the rows.
  3. Define the fields to be extracted dragging the node(s) of interest from the Source Schema tree into the Relative or absolute XPath expression fields.
    Note: You can select several nodes to drop on the table by pressing Ctrl or Shift and clicking the nodes of interest. The arrow linking an individual node selected on the Source Schema to the Fields to extract table are blue in colour. The other ones are gray.
  4. If needed, you can add as many columns to be extracted as necessary, delete columns or change the column order using the toolbar:
    • Add or delete a column using the and buttons.

    • Change the order of the columns using the and buttons.

  5. In the Column name fields, enter labels for the columns to be displayed in the schema Preview area.
  6. Click Refresh Preview to display a preview of the target schema. The fields are consequently displayed in the schema according to the defined order.
    Note: The preview functionality is not available if you loaded an XSD file.
  7. Click Next to check and edit the end schema.