Nestable Data Paths in Generic XML

The Nestable Data Path feature is only available during export of nested repeated structures using Generic XML.

  • The Nestable Data Paths in Generic XML Example (here) topic illustrates the concepts and capabilities provided by this feature.
  • This Nestable Data Paths in Generic XML and Performance (here) topic provides a step-by-step example to demonstrate how data paths can affect Generic XML performance.

Data Path Concept

The mapping step of the export wizard is used to bind Data Sources to Mapping Targets. Data sources evaluate and produce values for the export result relative to the object selected for export (for example product, entity, classification). When bound correctly, an ID data source will produce the ID of the object currently being processed for export, while an Attribute data source will produce the value of some specific attribute on the object being processed.

The Data Path data source makes it possible to change the object that other data sources, nested below the Data Path source, use when they are asked to evaluate. Instead of evaluating against the object being exported, they will be evaluated relative to some other object, or reference, reached by following a path from the exported object. For example, the following mapping target structure is produced by the Nestable Data Path Example:

  • Product-ID
  • Product-Name
  • Accessory (composite, multiple-cardinality)
    •  Accessory-ID
    • Accessory-Description
  • Image (composite, multiple-cardinality)
    • Image-ID
    • Image-Name

Mapping the existing ID data source to the Accessory-ID mapping target would result in exporting the ID value from the product.

Instead, mapping a Data Path data source to the Accessory composite target, configured with the path (Reference Accessory, Reference Target), two things will happen:

  • The Accessory sub-tree will be evaluated and output once for each reference of type Accessory found from the object being processed for export.
  • Data sources mapped in the sub-tree will be evaluated relative to the referenced products(s) found by following the data path.

The ID source mapped to Accessory-ID mapping target will result in the IDs of the accessory products, and an Attribute source mapped to Accessory-Description will produce an attribute value from the accessory object.

Nesting Concept

A Data Path can be inserted below another Data Path, creating a nesting effect.

By mapping a Data Path data source to the composite Image target, configured with the path (Reference Image, Reference Target), two things will happen:

  • The Image sub-tree will be evaluated and output once for each reference of type Image found from the accessory product found by the parent Data Path source.
  • Data sources mapped in the sub-tree will be evaluated relative to the referenced asset(s) found by following the Data Path.

An ID source mapped to Image-ID will produce the IDs of the asset associated with the accessory product, and a Name source mapped to Image-Name will produce the name of the asset.

Valid Path Step Types

Configuring the path of a Data Path source is made up of a number of path steps. Each step describes how to reach a new set of references or objects by moving from the references / objects reached by the previous step.

The first step in a top-level Data Path source is taken relative to the object being processed for export. Following steps, either in the same path or the path of a nested Data Source, are taken relative to the set of object or references produced by the preceding step.

The Data Path data source supports different types of path steps. Starting from the objects selected for export, it is valid to configure Data Path sources with initial steps of type Parent, Reference and Override Sub Product. Following steps, including steps configured for nested Data Path sources, are only valid according to the following rules:

Step Reach Valid followed by
Parent Parent node from node Parent
Reference Reference of a specific type from node Reference Target
Reference Target Target of a reference from a reference Reference
Override Sub Product Adopted children of a product-override node Reference

Note: Although the mapping step of the Data Export wizard does not prevent the user from configuring invalid paths, paths that are not valid will result in an undefined exported.

Data Sources Available for Data Paths

The data sources that are to be mapped below a Data Path source require special support for evaluating relative to the objects / references identified by the paths. The following standard data sources support such nesting:

  • ID
  • Name
  • Parent ID
  • Object-Type
  • Constant Value
  • Attribute
  • Attribute Group

Note: Data sources without special support evaluate relative to the object being processed for export even when placed below a Data Path source.