Solved

How can I extract XML attributes used as containers for data?


Your input would be much appreciated.

I don't know how to proceed and would like to avoid manipulating the source data manually to get it to do what I want.

 

I've received data which is formatted in the following manner. I'm posting the first item and closing it off just as it ends in the file with </markers>:

<markers>

<marker name="Tilburg"

    straat="Vloeiveldweg 6a"

    postcode="5048 TD"

    plaats="Tilburg"

    site=""

    lat="51.600739"

    lng="5.064299"

    linkurl="tilburg"

    status="0"

    dot="red.png"

    >

</markers>

 

I used an XMLFragmenter and it's configured as:

Elements to Match: markers/marker

Flatten Options: Enabled

01Feature Information shows:

02How do I go about extracting marker.name etc. into their own attributes with values? I've tried various combinations in Elements as XML Fragments but no dice.

icon

Best answer by nielsgerrits 1 June 2021, 14:36

View original

2 replies

Userlevel 6
Badge +32

Hej @toedeledokie​ (lol),

I think you only need to expose these attributes. You can do this by manually entering the attribute name in the "Attributes to Expose" field at the bottom of the XMLFragmenter. You can also use the AttributeExposer transformer if you prefer.

If you double click on an attribute value in the Feature Information window, a new window pops up from which you can copy the attributename to paste in the AttributeExposer.

If you use FME 2020 or newer, you can run the proces upstream the AttributeExposer with FeatureCaching on. Then you can easily click and select the unexposed attributes from a list:

2021-06-01_14h39_09

Hej @toedeledokie​ (lol),

I think you only need to expose these attributes. You can do this by manually entering the attribute name in the "Attributes to Expose" field at the bottom of the XMLFragmenter. You can also use the AttributeExposer transformer if you prefer.

If you double click on an attribute value in the Feature Information window, a new window pops up from which you can copy the attributename to paste in the AttributeExposer.

If you use FME 2020 or newer, you can run the proces upstream the AttributeExposer with FeatureCaching on. Then you can easily click and select the unexposed attributes from a list:

2021-06-01_14h39_09

Thank you! Kicking myself over it. It was staring me right in the face 😅

03 

"Hej @toedeledokie​ (lol),"

😉

Reply