Hi,
Trying to read xml data with XmlReader. Below are data and mapping files,
Mapping file 2 and 3 working fine. Mapping file 1 is giving exception (added below). Please clarify me is it expected behavior or issue with component.
Data File :
<Dataset>
<Entity2 attribute21="attribute21value">
<field21>field21value</field21>
<field22>field22value</field22>
</Entity2>
<Entity2>
<field22>field22value</field22>
<field23>field23value</field23>
<Entity21 attribute211="attribute211value">
<field211/>
<field212>field212value</field212>
</Entity21>
</Entity2>
</Dataset>
Mapping File 1 :
// DOES NOT WORK
<?xml version="1.0" encoding="UTF-8"?>
<Context xpath="Dataset">
<Context xpath="Entity2">
<Context outPort="0" xpath="Entity21">
<Mapping cloverField="targetfield2" xpath="field211"/>
<Mapping cloverField="targetfield1" xpath="@attribute211"/>
</Context>
</Context>
</Context>
ERROR MESSAGE :
Exception occured while transforming data.Component [XML_Reader] finished with status ERROR. (Out0: 1 recs, Out1: 0 recs)
XPath 'Entity2' contains two or more values!
Mapping File 2 :
// WORKS FINE
<?xml version="1.0" encoding="UTF-8"?>
<Context xpath="Dataset">
<Context outPort="0" xpath="Entity2/Entity21">
<Mapping cloverField="targetfield2" xpath="field211"/>
<Mapping cloverField="targetfield1" xpath="@attribute211"/>
</Context>
</Context>
Mapping File 3 :
// WORKS FINE
<?xml version="1.0" encoding="UTF-8"?>
<Context xpath="Dataset">
<Context outPort="0" xpath="Entity2">
<Mapping cloverField="targetfield" xpath="field21"/>
<Context outPort="1" xpath="Entity21">
<Mapping cloverField="targetfield2" xpath="field211"/>
<Mapping cloverField="targetfield1" xpath="@attribute211"/>
</Context>
</Context>
</Context>
Thank you,
Madan