I would like to ask a question about xml to excel conversion.
The purpose is to display several attributes that have the same key.
Here is an example :
For one code 567885 there are two attributes : Blue and Yellow.
When I use the XPath Node I can only choose 4 options :
Single Cell, Collection Cell, Multiple Columns, Mutiple Rows but there is no one which allows me to have Blue, Yellow in one colums.
Did you already see a XML structure which corresponds to something like below and do you think it could affect the conversion of all attributes for one key? :
<attributename=“[Standard] Blue (COLOR)”>A10AD01 ?
Generally speaking, you can either achieve this indeed through wildcard tagnames or extract all attributes first as node cell and then use another XPath query to retrieve the attributes. Whatever works best mainly comes down to what you have in your xml and what your desired output is.
If you could share a (anonymized) xml that reflects your data structure then for sure someone will be able to help you out with a more specific solution
Thanks for your quick answer !
I already tried with a second XPath but it seems it is not the good input format.
Here is an example of an XML input (only an extract) :
1234
RED23
BLU46
I would like to obtain in an excel file :
column 1 column 2 column 3
product code color name color code
1234 Red, Blue RED23,BLU46
I’m afraid this won’t help. It’s all down to the xml structure so I would encourage you to share a sample. Moreover, it’s unclear how you go from 1234 to 1234 Red and from RED23 to Blue RED23.
As you can see , I highlighted the Ingredient Role which is an Active Ingredient and an Excipient. For each PRD (a product identifier) , you can have many Ingredients roles. When I use the XPath node I only have :
PRDanonyme Active Ingredient
I would like to have
PRDanonyme Active Ingredient, Excipient
These two elements are in in this attached file : xml sample.docx (14.8 KB)
ingredientrole name=“Active Ingredient”>1/ingredientrole>
ingredientrole name=“Excipient”>2/ingredientrole>
Then I guess you’re looking for the substancecode where ingredientrole = 1.
Query it with /product/pharmaceuticalproducts/pharmaceuticalproduct/ingredients/ingredient[1]/substancecode and then with a String Manipulation node do join("Active Substance, Excipient ",$substancecode$)
Tip: whenever posting a question like this, please include your expected output in table format. It avoids this back and forth and takes away a lot of confusion and time wasted