Skip to main content
Solved

explode the properties of an XML element into attributes

  • September 18, 2018
  • 3 replies
  • 42 views

kimo
Contributor
Forum|alt.badge.img+10
  • Contributor
  • 96 replies

I have a bulk soap extract that has a list of assets with attributes as properties, not elements. I cannot find in the many XML transformers what I need to do to get the assets back into a simple table with each property as an attribute.

Here is a snippet of the first two AssetSummary elements.

Best answer by takashi

Hi @kimo, you can use the XMLFragmenter (Elements to Match: AssetSummary, Flatten Options/Enable Flattening: <checked>) to extract every attribute in the AssetSummary element as feature attributes.

Resulting features will have attributes which are named "AssetSummary.<original attribute name>", like this. Just be aware that you will have to expose them if necessary.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

takashi
Celebrity
  • 7843 replies
  • Best Answer
  • September 18, 2018

Hi @kimo, you can use the XMLFragmenter (Elements to Match: AssetSummary, Flatten Options/Enable Flattening: <checked>) to extract every attribute in the AssetSummary element as feature attributes.

Resulting features will have attributes which are named "AssetSummary.<original attribute name>", like this. Just be aware that you will have to expose them if necessary.


takashi
Celebrity
  • 7843 replies
  • September 18, 2018

Hi @kimo, you can use the XMLFragmenter (Elements to Match: AssetSummary, Flatten Options/Enable Flattening: <checked>) to extract every attribute in the AssetSummary element as feature attributes.

Resulting features will have attributes which are named "AssetSummary.<original attribute name>", like this. Just be aware that you will have to expose them if necessary.

In addition, you can use the BulkAttributeRenamer (Rename: All Attributes, Action: Remove Prefix String, String: AssetSummary.) to remove the prefix "AssetSummary." from all the attribute names.

kimo
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • 96 replies
  • September 19, 2018
In addition, you can use the BulkAttributeRenamer (Rename: All Attributes, Action: Remove Prefix String, String: AssetSummary.) to remove the prefix "AssetSummary." from all the attribute names.
Yes, did all that. That's the easy part!