I can load this file with a XML reader just fine. As you can see, there are multiple price tags per item. What I would like to achieve is a table where a row represents a price entry.
In this case I would have something like:
CD.id PRICE.country Price.Currency
1 fr eur
1 de eur
1 us usd
2 ... ...
I have tried using the XPath node to extract only prices: it works, but I lose the CD id, and if I add the CD.Id to the output, only one price is returned.
I was not able to find how to handle this situation, since most examples are based on “flat” data like CSV or database rows.
How would you do, and where to start?
I am a new Knime user, I might have missed something obvious.
Hi @PaulCombal,
welcome to the KNIME Forum, I am sure I can help you with this, I think all you need is the correct xpath setttings.
To help you find them could you be so kind and share a small sample of your input file with us? Maybe with the first two items?
Thank you @gab1one , I believe the input file I included in my first message (just above the picture) is enough to get the general idea. Do you need anything else?
I wanted to avoid typing it up by hand but in the end I just quickly did that. Anyway, take a look at this workflow, that should solve your problem:
I had to use two xpath nodes, in the first I split up the input file into cells one for each CD object, I then did the data extraction in the second xpath node.