Skip to main content
Question

XMLReader list creation

  • April 7, 2016
  • 1 reply
  • 17 views

Forum|alt.badge.img

Hi everyone, 

I've got a problem with the XML Reader in FME Desktop 2015. I want to read xml list attributes, and it works fine if a node contains multiple children like:

<feature>
  <networks>
            <network>
                <type></type>
                <linkage></linkage>
            </network>
            <network>
                <type></type>
                <linkage></linkage>
            </network>
        </networks>
</feature>

In this case the reader returns a list networks.network{}, which I need. BUT if networks contains only one network, then it does not return a list, but simple attributes like networks.network.type etc.

My Reader also lists the networks as a list, but in translation it becomes a simple attribute as mentioned. Is there a setting that I am missing? 

Feature Attributes:

0684Q00000ArC6IQAV.png

XMLReader settings:

0684Q00000ArBtKQAV.png

Thanks, 

mel

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.

1 reply

takashi
Celebrity
  • April 7, 2016

Hi @me1, switch the XML Flatten Options dialog to Advanced mode (click the left-bottom button), and modify the cardinality option like this.

cardinality="*/networks/network{}/+ +{?}"

See also here to learn more.