Home > Default > Use Message Mapping to repeat top node and split Message

Use Message Mapping to repeat top node and split Message

October 11Hits:1
Advertisement
I am currently using XSLT Messaging to do majority of the mapping. I have two issues that remain, I need to repeat the top node for each or its child elements and split the message.
<Sensor xmlns="namespace">
  <Observation>
    <XML>Some Data</XML>
</Observation
</Sensor>
1. Can it be done in XSLT? I posted a thread asking for help on this. Where I would need to repeat the Sensor tag for each observation. If this is possible then I will able to split the messages at the HTTP adapter used for the target system.
2. Can Message Mapping be used. Using the same xsd on both source and target systems, Will sensor repeat if set to 1:n and observation set to 1:1. In source it is Sensor 1:1, Observation 1:n.  If this works then I can use a BPM to shoot out individual messages using a for each.
Any help is greatly appreciated. I am fairly new to XI as this is my first major project. Thanks

Answers

Source File                                             Target File
> XI (XSLT) -
> Each observation as one file  ---> Out via HTTP
Batch of all orders    
Source File
<?xml version="1.0" encoding="ISO-8859-1"?>
<receipt>
  <manufacturer>Manufacture Name</manufacturer>
  <manufacturer_gln>999999</manufacturer_gln>
  <transfer_recipt>0123456</transfer_recipt>
  <prod>
    <product_GTIN>99999999999999</product_GTIN >
    <product_LOT>123456A</product_LOT >
    <production_date>20090131</production_date>
    <expire_date>20120131</expire_date>
    <carrier>
      <carrier_type>P</carrier_type>
      <carrier_barcode>001</carrier_barcode>
      <carrier_detail>
        <carrier>
          <carrier_type>C</carrier_type>
          <carrier_barcode>01</carrier_barcode>
          <carrier_detail>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089211</carrier_barcode></carrier>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089212</carrier_barcode></carrier>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089213</carrier_barcode></carrier>
            </carrier_detail>
        </carrier>
        <carrier>
          <carrier_type>C</carrier_type>
          <carrier_barcode>02</carrier_barcode>
          <carrier_detail>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089214</carrier_barcode></carrier>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089215</carrier_barcode></carrier>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089216</carrier_barcode></carrier>
            </carrier_detail>
        </carrier>
      </carrier_detail>
    </carrier>
    <carrier>
      <carrier_type>P</carrier_type>
      <carrier_barcode>002</carrier_barcode>
      <carrier_detail>
        <carrier>
          <carrier_type>C</carrier_type>
          <carrier_barcode>03</carrier_barcode>
          <carrier_detail>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089217</carrier_barcode></carrier>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089218</carrier_barcode></carrier>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089219</carrier_barcode></carrier>
          </carrier_detail>
        </carrier>
        <carrier>
          <carrier_type>C</carrier_type>
          <carrier_barcode>04</carrier_barcode>
          <carrier_detail>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089220</carrier_barcode></carrier>
            <carrier><carrier_type>ITEM</carrier_type><carrier_barcode>0108699547010089221</carrier_barcode></carrier>
           </carrier_detail>
        </carrier>
      </carrier_detail>
    </carrier>
  </prod>
</receipt>
Target File
<?xml version="1.0" encoding="UTF-8"?>
<pmlcore:Sensor xmlns:pmlcore="urn:autoid:specification:interchange:PMLCore:xml:schema:1" xmlns:pmluid="urn:autoid:specification:universal:Identifier:xml:schema:1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:autoid:specification:interchange:PMLCore:xml:schema:1 cases.xsd">
  <pmluid:ID>GPO_AI_LU_DC</pmluid:ID>
  <pmlcore:Observation>
    <pmlcore:DateTime>2008-10-13T17:53:00.265+02:00</pmlcore:DateTime>
    <pmlcore:Command>PACK</pmlcore:Command>
    <pmlcore:Tag>
      <pmluid:ID>01</pmluid:ID>
      <pmlcore:Data>
        <pmlcore:XML>
          <Memory>
            <DataField fieldName="EXPIRATION_DATE">20120131</DataField>
            <DataField fieldName="BATCH_ID">123456A</DataField>
            <DataField fieldName="ZMFG_DATE">20090131</DataField>
            <DataField fieldName="ZMFG_GLN">999999</DataField>
            <DataField fieldName="ZMANUFACTURER">Manufacture Name</DataField>
            <DataField fieldName="ZITEM_COUNT">16</DataField>
            <DataField fieldName="ZWORK_ORDER_NUMBER">0123456</DataField>
          </Memory>
        </pmlcore:XML>
      </pmlcore:Data>
    </pmlcore:Tag>
    <pmlcore:Tag>
      <pmluid:ID>0108699547010089211</pmluid:ID>
      <pmlcore:Data>
        <pmlcore:XML>
          <Memory>
            <DataField fieldName="EXPIRATION_DATE">20120131</DataField>
            <DataField fieldName="BATCH_ID">123456A</DataField>
            <DataField fieldName="ZMFG_DATE">20090131</DataField>
            <DataField fieldName="ZMFG_GLN">999999</DataField>
            <DataField fieldName="ZMANUFACTURER">Manufacture Name</DataField>
            <DataField fieldName="ZWORK_ORDER_NUMBER">0123456</DataField>
          </Memory>
        </pmlcore:XML>
      </pmlcore:Data>
    </pmlcore:Tag>
     </pmlcore:Observation>
     </pmlcore:Sensor>
I have the XSLT Mapping working to transform data from Source file to target File. But my target file has multiple Observations that need to be split into the Sensor, Observation structure.

Read other 7 answers

Tags:

Related Articles

  • Use Message Mapping to repeat top node and split MessageOctober 11

    I am currently using XSLT Messaging to do majority of the mapping. I have two issues that remain, I need to repeat the top node for each or its child elements and split the message. <Sensor xmlns="namespace">   <Observation>     <

  • PI Mapping problem - Repeating target nodesNovember 30

    Hello PI buddies! My PI mapping problem is as follows: I have a source IDoc which I wish to map to a JDBC Message Type. In the Idoc I have 2 repeating sections that I wish to combine to create a new node in the target for each combination of the 2 re

  • Top node of XML message needs value assign to it - how to do it ?November 30

    Hi, I have an issue where the top node of my XML message needs to have a value assigned. i.e. <REPORT>xxxxxxxx <ID>xxxxx</ID> <CUST>xxxxx</CUST> </REPORT> Is this possible using standard graphical mapping or will I need

  • Strange Errors from Import Server on Schema-based maps for repeating nodesOctober 11

    I have already posted one thread about this, but perhaps some more in-depth information is required: We have uploaded our schema into the console, and have mapped the following multi-node file to it: CUSTOMER <repeating node>   MDM_CUST (new Custome

  • Mapping from repeating header to unique headers.November 30

    Dear experts, I would like to map a repeating segment of an Idoc structure to 5 segments with each different names of the target structure. The underlying fieldnames are identical. Ofcourse the number of segments in the source structure is 1, with ca

  • Graphical mapping issue, repeated lines are not populatingNovember 30

    Hello All, i have mapping where i need to map source node and its coresponding subelements to target node and its subelemtns based on certains condition, which i did using If condition. Now my issue is, when mapped source node with condition , condit

  • Is Multi Mapping will work with  node function useAsMany with SP10 ?November 30

    Hi friends,                 I  am  working some sample Multi Mapping scenario . My XI 3.0   SP is  10 .                 I am getting the following error , while i am testing the Mapping with <b>useAsMany Node function </b> it  is giving the Fo

  • WD ABAP: Recursion Nodes that Repeat Tree Nodes with Embedded Tables ???November 30

    At Rich H's suggestion, I'm posting this here as well as in the blogs. Suppose you've got a tree context with a node that has a table embedded under it. (For example, the TREE_WITH_TABLE view of WDR_TEST_EVNT has this kind of context substructure.) C

  • D3L "produce" error: unable to find attribute object for top nodeNovember 30

    Hi I'm new to this forum, hope someone can help me with this because it's really been causing a headache for a few days now. I'm trying to deliver a flat file message with an interconnect standard ftp adapter. All the transformations go well but then

  • Parent of Top node is getting added as Orphan nodeOctober 11

    Hi , When I am trying to import the below test import file in DRM 11.1.2 - [hier] Product|P000000 [node] P000000 [relation] P000000|None|Total Product|True the parent of top node P000000 which is 'None' as defined in System preferences , is getting a

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.719 s.