Hi I’ve configured a nested mapping for my XML Writer which appears to work, but I’m getting unwanted repeating elements:
Input:
** **Port 0:** **key: 0001** **Port 1:** **key: 0001** **evtType: ADD** **Port 2:** **key: 0001** **Port 3:** **key: 0001** **srcCode: SRCA** **memIdnum: 0001** **Port 4:** **key: 0001** **attrCode: ATTRA** **dataA1: blahA1** **dataA2: blahA2** **...** **Port 5:** **key: 0001** **attrCode: ATTRB** **dataB1: blahB1** **dataB2: blahB2** **...** **
My mapping looks like this:
** **<Mapping** **inPort="0"** **element="EmpiMsg"** **key="key"** **fieldsIgnore="key" >** **<Mapping** **inPort="1"** **element="MsgHeader"** **key="key"** **parentKey="key"** **fieldsIgnore="key" >** **</Mapping>** **<Mapping** **inPort="2"** **element="Member"** **key="key"** **parentKey="key"** **fieldsIgnore="key" >** **<Mapping** **inPort="3"** **element="MemHead"** **key="key"** **parentKey="key" >** **</Mapping>** **<Mapping** **inPort="4"** **element="ATTRA"** **key="key"** **parentKey="key"** **fieldsIgnore="key" >** **</Mapping>** **<Mapping** **inPort="5"** **element="ATTRB"** **key="key"** **parentKey="key"** **fieldsIgnore="key" >** **</Mapping>** **</Mapping>** **</Mapping>** **
I’m expecting to see:
** **<?xml version="1.0" encoding="ISO-8859-1"?>** **<EmpiMsg>** **<MsgHeader>** **<evtType>ADD</evtType>** **</MsgHeader>** **<Member>** **<MemHead>** **<srcCode>SRCA</srcCode>** **<memIdnum>0001</memIdnum>** **</MemHead>** **<ATTRA>** **<attrCode>ATTRA</attrCode>** **<dataA1>blahA1</dataA1>** **<dataA2>blahA2</dataA2>** **</ATTRA>** **<ATTRB>** **<attrCode>ATTRB</attrCode>** **<dataB1>blahB1</dataB1>** **<dataB2>blahB2</dataB2>** **</ATTRA>** **</Member>** **</EmpiMsg>** **
But I’m actually seeing repeating segments of the same data even though there’s only one input record:
** **<?xml version="1.0" encoding="ISO-8859-1"?>** **<EmpiMsg>** **<MsgHeader>** **<evtType>ADD</evtType>** **</MsgHeader>** **<Member>** **<MemHead>** **<srcCode>SRCA</srcCode>** **<memIdnum>0001</memIdnum>** **</MemHead>** **<ATTRA>** **<attrCode>ATTRA</attrCode>** **<dataA1>blahA1</dataA1>** **<dataA2>blahA2</dataA2>** **</ATTRA>** **<ATTRB>** **<attrCode>ATTRB</attrCode>** **<dataB1>blahB1</dataB1>** **<dataB2>blahB2</dataB2>** **</ATTRA>** **</Member>** **<Member>** **<MemHead>** **<srcCode>SRCA</srcCode>** **<memIdnum>0001</memIdnum>** **</MemHead>** **<ATTRA>** **<attrCode>ATTRA</attrCode>** **<dataA1>blahA1</dataA1>** **<dataA2>blahA2</dataA2>** **</ATTRA>** **<ATTRB>** **<attrCode>ATTRB</attrCode>** **<dataB1>blahB1</dataB1>** **<dataB2>blahB2</dataB2>** **</ATTRA>** **</Member>** **<Member>** **<MemHead>** **<srcCode>SRCA</srcCode>** **<memIdnum>0001</memIdnum>** **</MemHead>** **<ATTRA>** **<attrCode>ATTRA</attrCode>** **<dataA1>blahA1</dataA1>** **<dataA2>blahA2</dataA2>** **</ATTRA>** **<ATTRB>** **<attrCode>ATTRB</attrCode>** **<dataB1>blahB1</dataB1>** **<dataB2>blahB2</dataB2>** **</ATTRA>** **</Member>** **</EmpiMsg>** **
Any ideas why or how to fix it? Or any better approaches?
Thanks!