cancel
Showing results for 
Search instead for 
Did you mean: 

removing header node in xml file

Former Member
0 Kudos

Hi Experts,

Actually i want to remove the parentnode tag from the resultant output, do we have any java code to remove such xml nodes.

mt_receiver

HeaderNode

--Field1

--Field2

ParentNode

PurchaseOrder

--Field1

--Field2

PurchaseHeader

--Field1

--Field2

Details

--Field1

--Field2

--Field3

ParentNode

PurchaseOrder

--Field1

--Field2

PurchaseHeader

--Field1

--Field2

Details

--Field1

--Field2

--Field3

regards,

sai

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

Did you give the receiver MT structure....Dont map the node to any source node/ element....and if thmin. e occurence is 0 then you wont have that node in the output file......is this the logic that you are looking for?

Regards,

Abhishek.

Former Member
0 Kudos

Hi,

Actually i have to process multiple purchase orders which is coming from IDOC and when i didn't use the parent node i am getting all the purchase orders and then purchase order header followed with details,

But i need the detials records and purchase order header corresponding to the purchase order, so for that i have define parent node, but at the output i dont require this parent node..

i mean the output shuld look like below by removing parent node.

mt_receiver

HeaderNode

--Field1

--Field2

PurchaseOrder

--Field1

--Field2

PurchaseHeader

--Field1

--Field2

Details

--Field1

--Field2

--Field3

PurchaseOrder

--Field1

--Field2

PurchaseHeader

--Field1

--Field2

Details

--Field1

--Field2

--Field3

i think you understand now..

regards,

sai

former_member200962
Active Contributor
0 Kudos
i think you understand now

ok....now got something

So you are saying that there is ParentNode which is having sub-elements as PurchaseOrder and Details....now you want to have the structure without ParentNode i.e. only PurchaseOrder and Details hsoule be present.

My question why you want to remove ParentNode? If you remove ParentNode then all the PurchaseOrder nodes will come one after the other and all the Details nodes will come as a separate group:

mt_receiver

HeaderNode

PurchaseOrder

PurchaseOrder

PurchaseHeader

PurchaseHeader

Details

Details

Do you want such a sequence to occur?

Regards,

Abhishek.

Former Member
0 Kudos

Hi,

Intially without defining the parentnode i have defined the structure and i got the output as defined by you i.e i got all the purchase order once and then purchase order header followed with details records, Here we dont know which detail record corresponds to purchase order,

So i have changed the structure and kept ParentNode as the root for the purchase order, purchare order header and for the detail

now in the output client requires without the parent node. the structure which i shown in the above discussion..

Hope you got my requirement,

regards,

Sai,