Skip to main content

Hi everyone, 

I don't know how to work with listattributes inside the XMLTemplater Transformer. 

A feature contains a list networks.network{}, foreach element in the list, I want to create a new child element "networkNode".

Do I have to loop threw the elements and create the xml for each, or is it possible to do it directly in the XMLTemplater? 

networks.network{0}.type = type0
networks.network{0}.linkage = linkage0
networks.network{1}.type = type1
networks.network{1}.linkage= linkage1

What I want my XML to look like: 

<OnlineContact>
  <aixm:networkNode>  
            <aixm:network>type0</aixm:network>
            <aixm:linkage>linkage0</aixm:linkage>
         </aixm:OnlineContact>
     </aixm:networkNode>
    <aixm:networkNode>  
            <aixm:network>type1</aixm:network>
            <aixm:linkage>linkage1</aixm:linkage>
         </aixm:OnlineContact>
     </aixm:networkNode>
</OnlineContact>

I am using FME Desktop 2015

Thanks, Mel

One possibility is to use a ListExploder on the list, then add them into the XmlTemplater using a Sub template.

I've included a sample that I believe achieves what you are trying to do in the workspace below:


One possibility is to use a ListExploder on the list, then add them into the XmlTemplater using a Sub template.

I've included a sample that I believe achieves what you are trying to do in the workspace below:

Thanks, it does exactly what I want :)


Reply