我有一个XML文件,其中包含以下格式的数据:
<LineHeader>
<LineItem LineNumber="1">
<Product SKU="99991L" DespatchQuantity="70">
<Item Type="EANCode">0821793005795</Item>
<SKUDescription1>HTC SNAP SYST</SKUDescription1>
<SKUDescription2 />
<SerialNumberHeader>
<SerialNumber>358991022404733</SerialNumber>
<SerialNumber>358991022404808</SerialNumber>
</SerialNumberHeader>
</Product>
</LineItem>
<LineItem LineNumber="2">
<Product SKU="37099M" DespatchQuantity="50">
<Item Type="EANCode">0843163067660</Item>
<SKUDescription1>RIM KEPLER SYST</SKUDescription1>
<SKUDescription2 />
<SerialNumberHeader>
<SerialNumber>353933040011632</SerialNumber>
<SerialNumber>353933042759923</SerialNumber>
</SerialNumberHeader>
</Product>
</LineItem>
</LineHeader>
现在我希望输出是一个具有列名和记录的文本文件,如下所示:
LineItem
LineNumber Product SKU EANCode SKUDescription1 SerialNumber
1 99991L 821793005795 HTC SNAP SYST 358991022404808
1 99991L 821793005795 HTC SNAP SYST 358991022434987
1 99991L 821793005795 HTC SNAP SYST 358991022435505
2 37099M 843163067660 RIM KEPLER SYST 353933040011632
2 37099M 843163067660 RIM KEPLER SYST 353933042759923
输出数据应如上表所示。我们如何在pentaho中实现循环。