Skip to main content Skip to complementary content

Importing an XML schema

You can import an XML Schema Definition (XSD) or Web Services Definition Language (WSDL) to Talend Data Mapper.

About this task

An XML Schema describes the structure of an XML document, including its elements and attributes, the number and order of child elements, data types for the specified elements and attributes, and even default or fixed values for the specified elements and attributes.

Information noteNote: Talend Data Mapper only supports XSD 1.0.

Procedure

  1. In the Data Mapper tab, expand the Hierarchical Mapper node and right-click Structures.
  2. Click New > Structure.
  3. In the wizard that opens, select Import a structure definition and click Next.
  4. Select the type of import, XML Schema (XSD) for example, and click Next.
  5. Select the file to use:
    • Select an existing resource in your workspace.
    • Import a local file.
    • Import a local folder.
    • Enter the URL to the file.
  6. Click Next.
  7. Select how to organize the imported structures:
    • One folder per namespace prefix (default option): Stores the structure in a folder named after the namespace prefixes in the XML schema.
    • As a tree based on namespace tokens: Organizes a structure in a hierarchy of folders using the namespace tokens.
    • One folder per namespace: Creates folders with names that are built with the namespaces rather than prefixes. Invalid characters are replaced with underscores.
  8. Optional: If you want to keep the original depth of the schema, you can clear the Optimize generated structures (reduce size/depth) check box.

    When you import a complex XSD, you get invisible elements that represent complex types extending other complex types, substitution groups or abstract types. The optimization option removes the invisible elements by moving their children to a higher level to reduce the depth of the structure.

  9. Optional: If you want to exclude some complex types, enter them in the corresponding field:
    Talend Data Mapper automatically excludes XHTML and XSD types. Elements with these complex types are assigned the xsd:any type. You can exclude more types if needed.
  10. Select a folder and enter a name for your structure, then click Next.
  11. Click Finish.

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 – please let us know!