# how to convert xml to table

**URL:** <https://forum.knime.com/t/how-to-convert-xml-to-table/11743>\
**Category:** KNIME Analytics Platform\
**Created:** [August 2, 2018, 10:40am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743 "2018-08-02T10:40:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivanisrivarshini](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@shivanisrivarshini](https://forum.knime.com/u/shivanisrivarshini)\
**Post date:** [August 2, 2018, 10:40am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/1 "2018-08-02T10:40:58Z")

</div>

[Laptops\_Train.xml](https://forum-cdn.knime.com/uploads/default/original/2X/f/fdc5743335c839d69c2affe6511ba955eac55ac4.xml) (673.2 KB)  
I want to extract all the aspectTerms  
How can I extract aspectTerms from this XML in table format

---

<div class="post-metadata">

**Author:** ![qqilihq](https://forum-cdn.knime.com/user_avatar/forum.knime.com/qqilihq/32/50_2.png) [@qqilihq](https://forum.knime.com/u/qqilihq)\
**Post date:** [August 2, 2018, 10:48am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/2 "2018-08-02T10:48:46Z")

</div>

You can use the XPath node for that.

> **[XPath — NodePit](https://nodepit.com/node/org.knime.xml.node.xpath2.XPathNodeFactory)**
>
> Performs XPath queries on a XML column.

---

<div class="post-metadata">

**Author:** ![shivanisrivarshini](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@shivanisrivarshini](https://forum.knime.com/u/shivanisrivarshini)\
**Post date:** [August 2, 2018, 10:50am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/3 "2018-08-02T10:50:39Z")

</div>

ya i did for all other but   
how can i have aspectTerms as title and have all set of aspectTerm in single cell

---

<div class="post-metadata">

**Author:** ![qqilihq](https://forum-cdn.knime.com/user_avatar/forum.knime.com/qqilihq/32/50_2.png) [@qqilihq](https://forum.knime.com/u/qqilihq)\
**Post date:** [August 2, 2018, 10:57am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/4 "2018-08-02T10:57:12Z")

</div>

> [@shivanisrivarshini](#):
>
> how can i have aspectTerms as title and have all set of aspectTerm in single cell

You can extract multiple values to a single collection cell. There’s an option for that in the node configuration under “Multiple tag options”.

---

<div class="post-metadata">

**Author:** ![shivanisrivarshini](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@shivanisrivarshini](https://forum.knime.com/u/shivanisrivarshini)\
**Post date:** [August 2, 2018, 11:00am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/5 "2018-08-02T11:00:13Z")

</div>

![image](https://forum-cdn.knime.com/uploads/default/original/2X/5/5da7c11667cddf3dee70e20233b934c4c4488a75.png)  
U mean  
XPath data tag =string cell  
Multiple tag options = collectiion cell

---

<div class="post-metadata">

**Author:** ![shivanisrivarshini](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@shivanisrivarshini](https://forum.knime.com/u/shivanisrivarshini)\
**Post date:** [August 2, 2018, 11:02am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/6 "2018-08-02T11:02:08Z")

</div>

![image](https://forum-cdn.knime.com/uploads/default/original/2X/8/804b82a854fc159f544f53f52142362b71a342d1.png)  
this is how im getting output if i keep  
XPath data tag =string cell  
Multiple tag options = collectiion cell

---

<div class="post-metadata">

**Author:** ![shivanisrivarshini](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@shivanisrivarshini](https://forum.knime.com/u/shivanisrivarshini)\
**Post date:** [August 2, 2018, 11:09am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/7 "2018-08-02T11:09:08Z")

</div>

![image](https://forum-cdn.knime.com/uploads/default/original/2X/5/5e29c664f333f9715879a593768f2d775ddfbccd.png)  
XPath data tag =node cell  
Multiple tag options = collectiion cell

---

<div class="post-metadata">

**Author:** ![shivanisrivarshini](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@shivanisrivarshini](https://forum.knime.com/u/shivanisrivarshini)\
**Post date:** [August 2, 2018, 11:17am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/8 "2018-08-02T11:17:10Z")

</div>

how can i get aspectTerms and all its attributes

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [August 3, 2018, 7:00am UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/9 "2018-08-03T07:00:05Z")

</div>

Could you try converting it to JSON before extracting it? Could be worth a try.

> [@Problems with parsing a XML-like file](https://forum.knime.com/t/problems-with-parsing-a-xml-like-file/11463/4):
>
> I attach a workflow that extracts your values. I converted the XML file to JSON and then used the JSON path editor to define a path. The tricky thing is to find the path. That took some time. I exported the JSON file and used an editor (Atom on MacOS) to find the right row. Then you would have to click on an item you want and hopefully it would select and mark blue the values you want. I am not a JSON expert so I would have to click around until it fits. Then the workflow would ungroup the valu…

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:30pm UTC](https://forum.knime.com/t/how-to-convert-xml-to-table/11743/10 "2023-06-23T20:30:26Z")

</div>


