hi all, need some help in this weird behavior i noticed when i try to loop the output with the same value in the output.
output is suppress if the value is the same value in xml.
I want to output P0401 to cbc:PackQuantity and P0414 to PackSizeNumeric
INPUT LOOKS LIKE THIS:
PO1*0000001129*90576*EA*2.82*PE*SK*1998788*ST*GB8FDC*UP*032251802706
CTP**RTL*7
PID*F****Cat Orange
PO4*144*************8
PO1*0000001444*24048*EA*1.58*PE*SK*1998802*ST*BA209FD*UP*085612216582
CTP**RTL*7
PID*F****Black Dog
PO4*144*************8
OUTPUT --> If you notice output the second loop of item is not having the PackQuantity and cbc:PackSizeNumeric is missing..
BUT INCASE that in input have different Value it works fine. in PO401 and PO414, the tag wont dissapear and it will output correct
<cac:GoodsItem>
<cac:Item>
<cbc:UUID>1</cbc:UUID>
<cbc:Description>Cat Orange</cbc:Description>
<cbc:Quantity>1007</cbc:Quantity>
<cbc:PackQuantity>144</cbc:PackQuantity>
<cbc:PackSizeNumeric>8</cbc:PackSizeNumeric>
<cbc:Price>2.82</cbc:Price>
</cac:Item>
<cac:Item>
<cbc:UUID>2</cbc:UUID>
<cbc:Description>Black Dog/cbc:Description>
<cbc:Quantity>2007</cbc:Quantity>
<cbc:Price>1.58</cbc:Price>
</cac:Item>
</cac:GoodsItem>
BUT INCASE that in input have different Value it works fine. in PO401 and PO414, the tag wont dissapear and it will output correct
EXAMPLE
INPUT
PO1*0000001129*90576*EA*2.82*PE*SK*1998788*ST*GB8FDC*UP*032251802706
CTP**RTL*7
PID*F****Cat Orange
PO4*144*************8
PO1*0000001444*24048*EA*1.58*PE*SK*1998802*ST*BA209FD*UP*085612216582
CTP**RTL*7
PID*F****Black Dog
PO4*111*************5
THEN OUPUT WOULD BE LIKE THIS
<cac:GoodsItem>
<cac:Item>
<cbc:UUID>1</cbc:UUID>
<cbc:Description>Cat Orange</cbc:Description>
<cbc:Quantity>1007</cbc:Quantity>
<cbc:PackQuantity>144</cbc:PackQuantity>
<cbc:PackSizeNumeric>8</cbc:PackSizeNumeric>
<cbc:Price>2.82</cbc:Price>
</cac:Item>
<cac:Item>
<cbc:UUID>2</cbc:UUID>
<cbc:Description>Black Dog/cbc:Description>
<cbc:Quantity>2007</cbc:Quantity>
<cbc:PackQuantity>111</cbc:PackQuantity>
<cbc:PackSizeNumeric>5</cbc:PackSizeNumeric>
<cbc:Price>1.58</cbc:Price>
</cac:Item>
</cac:GoodsItem>