Table of Contents

Search

  1. Preface
  2. Introduction to Data Transformation
  3. Data Processor Transformation
  4. Wizard Input and Output Formats
  5. Relational Input and Output
  6. Using the IntelliScript Editor
  7. XMap
  8. Libraries
  9. Schema Object
  10. Command Line Interface
  11. Scripts
  12. Parsers
  13. Script Ports
  14. Document Processors
  15. Formats
  16. Data Holders
  17. Anchors
  18. Transformers
  19. Actions
  20. Serializers
  21. Mappers
  22. Locators, Keys, and Indexing
  23. Streamers
  24. Validators, Notifications, and Failure Handling
  25. Validation Rules
  26. Custom Script Components

User Guide

User Guide

Mapper Configuration

Mapper Configuration

Key
components define identifiers for the data holders.
  • The first
    Key
    specifies that the
    id
    attribute is a unique identifier of a
    Parent
    element.
  • The second
    Key
    specifies that the
    name
    attribute is a unique identifier of a
    Hobby
    element.
level 1 ParentKey = Key >> level 2 recurring_element = /Report/*s/Parents/*s/Parent level 2 unique_fields = Level 3 /Report/*s/Parents/*s/Parent/@id level 3 ... level 1 HobbyKey = Key >> level 2 recurring_element = /Hobbies/*s/Hobby level 2 unique_fields = Level 3 /Hobbies/*s/Hobby/@name level 3 ...
The Script then defines a
Mapper
with the following configuration:
global level HobbiesMapper = Mapper >> level 2 source = [Locator(/Report)] level 2 target = [Locator(/Hobbies)] level 2 contains line level 2 RepeatingGroupMapping >> level 3 source = level 4 Locator >> level 5 data_holder = /Report/*s/Children/*s/Child level 4 LocatorBykey >> level 5 key = /Report/*s/Parents/*s/Parent/[@id=$1] level 5 params = [/Report/*s/Children/*s/Child/@parentID] level 4 ... level 3 target = level 4 Locator >> level 5 data_holder = (/Hobbies/*s/Hobby/*s/Person) level 4 LocatorBykey >> level 5 key = /Hobbies/*s/Hobby/[@name=$1] level 5 params = [/Report/*s/Children/*s/Child/@hobby] level 4 ... level 3 contains line level 3 Map >> level 4 source = /Report/*s/Children/*s/Child/@name level 4 target = /Hobbies/*s/Hobby/*s/Person/@firstName level 4 transformers = [] level 3 Map >> level 4 source = /Report/*s/Parents/*s/Parent/@lastName level 4 target = /Hobbies/*s/Hobby/*s/Person/@lastName level 4 transformers = [] level 3 ... level 2 ...
The components of the
Mapper
perform the following functions:
  • The
    source
    property of the
    RepeatingGroupMapping
    specifies that each iteration gets its input from the following data holders:
    • From an occurrence of the
      Child
      element
    • From the corresponding occurrence of the
      Parent
      element
  • The
    target
    property of the
    RepeatingGroupMapping
    specifies that each iteration stores its output in the following data holders:
    • In an occurrence of the
      Person
      element
    • In the corresponding occurrence of the
      Hobby
      element
  • The first
    Map
    action copies the
    name
    attribute of the
    Child
    to the
    firstName
    attribute of the
    Person
    .
  • The second
    Map
    action copies the
    lastName
    attribute of the
    Parent
    into the
    lastName
    attribute of the
    Person
    .

0 COMMENTS

We’d like to hear from you!