cancel
Showing results for 
Search instead for 
Did you mean: 

Importing Multi-Node XML Files

Former Member
0 Kudos

We are trying to import xml files that will be returned from XI and imported with one map and the Import Manager. Here is the XML structure:

  <?xml version="1.0" encoding="UTF-8" ?> 
- <ns1:CustomerCreateResp xmlns:ns1="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
- <CUSTOMER>
    <CUSTOMERNO /> 
    <MDMCUSTOMER /> 
    <CREATE_DATE /> 
- <RETURN>
    <TYPE /> 
    <MESSAGE /> 
  </RETURN>
- <PT_CONTPART_RETURN>
  - <item>
      <MDM_CONTACT /> 
      <CONTACT /> 
    </item>
  </PT_CONTPART_RETURN>
- <PARTNERS>
  - <item>
      <CUSTOMERNO /> 
      <PARTNER_FUNCTION /> 
      <PARTNER_NUMBER /> 
      <DEFAULT_PARTNER /> 
    </item>
  </PARTNERS>
  </CUSTOMER>
  </ns1:CustomerCreateResp>

The trick is that there can be multiple CUSTOMERS returned in one file and within each one, there can be either one or more PT_CONTPART_RETURN items and one or more PARTNER_FUNCTION nodes. I will create a map for one node and it will see the structure differently when I try to reuse the map with a file returning more than one node. The reverse is also true. My problem is that I need ONE MAP for the return file, regardless of how many nodes it has. Oh, and just to make it fun, both PT_CONTPART_RETURN and PARTNER_FUNCTION map to qualified lookup tables which, surprisingly, isn't an issue.

Thank you all in advance!

Don

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You have to create a XSD with repeatable nodes per your specification.

Save this XSD in MDM Console.

Use a sample xml with repeatable elements based on the above xsd.

Now open the Import Manger with Destination Properties as XML Schema stored in MDM, and the sample XML File created in the previous step.

Use this XML file to map to the MDM Destination Hierararchy.

Save this Map.

Create a port and assign this map.

This way you can use the same map irrespective of whether the xml file has repeatable nodes or not.

Hope this helps.

michael_theis
Active Contributor
0 Kudos

In addition to Adhappan's reply you have to define the namespace when you add your new XSD using the URL field. Ortherwise you may have some trouble with the validation of the XML against the XSD.

Kind regards

Michael

Former Member
0 Kudos

Adhappan, Thank you very much for your insightful response. It really helped me out. Something else I discovered, and something that was killing me, was the fact that the original schema, multiple customers were allowed, but MDM would see them differently producing a join if more than one and automatically flattening the file if only one. Thus, the map for multiple customers would not work for single customers and vice versa. But having the XI team recreate the schema to produce "items" for the Customers as well as the two repeating subnodes allowed me to bring in the schema and produce my maps. Also, Michael's post about the namespace issue (after I figured out where that was coming from) was a lifesaver. Now if I could just get the automatic value mapping to work. Thanks again! Don

Former Member
0 Kudos

Michael, Thank you very much for your insightful response. It really helped me out. Something else I discovered, and something that was killing me, was the fact that the original schema, multiple customers were allowed, but MDM would see them differently producing a join if more than one and automatically flattening the file if only one. Thus, the map for multiple customers would not work for single customers and vice versa. But having the XI team recreate the schema to produce "items" for the Customers as well as the two repeating subnodes allowed me to bring in the schema and produce my maps. Now if I could just get the automatic value mapping to work. Thanks again! Don

Answers (0)