In the default setting, each field is in the context of the higher-level field.
Fix and Foxy are in the first flat context, Jolly Jumper and Lucky Luke are in the second, and all four are in the first street context. The first
Let us assume that you want to map this structure to the following list to include all those people from the first city and the first street:
The root node (in this case
You want to list all four people from the first street context (Fix, Foxy, Lucky Luke, and Jolly Jumper). Define a target field mapping for
\personList\person=\root\city\street\flat\person
This XML instance produces the following result:
It only generates Fix and Foxy from the first flat context. To understand why this is the case, we can look at the processing:
...
1. The root node
2. The message mapping checks in the
3. The message mapping generates fields in the target structure for Fix and Foxy in the first flat context. Once the first flat context has been processed it is closed along with the
The transformation is completed with the last step because all target structure fields have been processed. The example shows the following:
· The
· The list only includes Fix and Foxy because they are in a different context to Jolly Jumper and Lucky Luke.
You can set the context individually for each field in the source structure in the Data-Flow Editor context menu. If you set the
Structure Mappings Using Different Contexts of the
Context of \root\city\street\flat\person | Results list |
flat (default setting) |
|
street |
|
city |
|
root |
|
The removeContexts() standard function assigns the fields assigned to it to the root node. You will get the same effect if you assign the root context to this type of field.
The higher-level context of an attribute is the element to which it is assigned. The above statements relating to fields also apply to attributes.
Technically speaking, the XML instance is imported into the queues before the target field mappings are processed. The contexts are separated in the queue by a context change. You can address these queues directly in advanced user-defined functions.
No comments:
Post a Comment