Hi
I have a message containing
<?xml version="1.0" encoding="utf-8"?>
<Items xmlns:json="http://arc.cdata.com/ns/jsonconnector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<envelopes json:array="true">
<envelopeId>a9b6d6d0-393a-4542-9441-ae622f84f8dd</envelopeId>
<recipients json:array="true">
<recipientId>0da3068e-da57-42c5-a99a-432f0822aa59</recipientId>
<email>[email protected]</email>
<name>Russell Hutson</name>
<formData json:array="true">
<name>Your_Ref_RGR 1cda86af-e7ff-4812-9be8-6f45b98b72e8</name>
<value>65546546546</value>
</formData>
<formData json:array="true">
<name>Co_Address_Line1_RGR f53b822c-d976-43ce-b786-dbfa7c46be12</name>
<value>Test 1</value>
</formData>
<formData json:array="true">
<name>Co_Add_Line2_RGR bc4630a4-3e29-49df-b22a-1f911439666e</name>
<value>test 2</value>
</formData>
<formData json:array="true">
<name>Goods_Desc_RGR 5ef6d1e9-4b62-47bd-b6fa-7eff52f5900e</name>
<value>Trousers</value>
</formData>
<formData json:array="true">
<name>Number_Pkgs_RGR 4418142a-f17d-4b52-b6cf-7e811366554e</name>
<value>1.00</value>
</formData>
<formData json:array="true">
<name>Goods_Weight_RGR cafffa30-a2fb-4384-bb78-80e02e73c630</name>
<value>1</value>
</formData>
<formData json:array="true">
<name>Goods_Value_RGR 4c1734e3-8d23-4f13-8e6e-01de00dccded</name>
<value>£1.00 GBP</value>
</formData>
<formData json:array="true">
<name>Company</name>
<value>Test</value>
</formData>
<formData json:array="true">
<name>Co_Post_Town_RGR 485f6550-3ce5-49fa-8d3a-d6ae7a7fd65e</name>
<value>Test 3</value>
</formData>
<formData json:array="true">
<name>Co_Postcode_RGR 151348bf-6f56-4dda-8af0-1fb7dd6bdc46</name>
<value>Test 4</value>
</formData>
<formData json:array="true">
<name>Goods_Comm_Code_RGR 2af9573e-1068-49dd-b38a-10ea82b273de</name>
<value>123,456.00</value>
</formData>
<formData json:array="true">
<name>Goods_Reason_List_RGR aef8ffda-9cfd-4b04-badf-664a83197f34</name>
<value>Faulty</value>
</formData>
<formData json:array="true">
<name>FullName</name>
<value>Russell Hutson</value>
</formData>
<formData json:array="true">
<name>EORI_RGR 079837e9-d35e-4bd4-8eb0-712b1c4de552</name>
<value>12345</value>
</formData>
<formData json:array="true">
<name>DateSigned</name>
<value>6/19/2023</value>
</formData>
</recipients>
</envelopes>
</Items>
Which I need to flatten into a eventually to a CSV File.
How do I map it to become
<data>
<Your_Ref_RGR>65546546546</Your_Ref_RGR>
<Co_Address_Line1_RGR>Test 1</Co_Address_Line1_RGR>
...
<FullName>Russell Hutson</FullName>
<EORI_RGR>12345</EORI_RGR>
</data>
I tried using a Lookahead in XML Map like this
/xpath(/Items/envelopes/recipients/formData\mname=\'Your_Ref_RGR 1cda86af-e7ff-4812-9be8-6f45b98b72e8\'\]/value)]
but get an error
Error:
Static function c RSSBus.RsbOps.RSBFunctions.xpath("/Items/envelopes/recipients/formDatarname='Your_Ref_RGR 1cda86af-e7ff-4812-9be8-6f45b98b72e8']/value") ] failed in the evaluation of <data ;output1.output]="poutput2.output | xmlencode(false)]"> <Your_Ref_RGR>Gxpath("/Items/envelopes/recipients/formData\mname='Your_Ref_RGR 1cda86af-e7ff-4812-9be8-6f45b98b72e8'\]/value") | def | xmlencode(false)]</Your_Ref_RGR> <Co_Address_Line1_RGR>Test 1</Co_Address_Line1_RGR> <FullName>Russell Hutson</FullName> <EORI_RGR>12345</EORI_RGR></data>. The error was:Execute 'RSSBus.RsbOps.RSBFunctions.xpath' function failed: Exception has been thrown by the target of an invocation. Unable to find XML object, make sure the file has been loaded.