Skip to main content
Question

How to concatenate list when attribute values are missing?


Forum|alt.badge.img
I want to concatenate this list using the value of "aspects.a.v"

 

 <aspects> <a id="1" l="de" v="ONE"/> <a id="2" p="5" code="6"/> <a id="3" p="10" code="3"/> <a id="39" l="de" v="TWO"/> <a id="41" l="de" v="THREE"/> <a id="57" l="de" v="FOUR"/> </aspects>
 

 

Because aspects.a.v{2} and  aspects.a.v{3} are missing, only the first "aspects.a.v" element "ONE" ist being concatenated. I Want ONE, TWO, THREE; FOUR to appear in my concatenated list. How can I solve this problem?

5 replies

Hi,

 

 

Chuvag, ti ne zamorachivaysia s FME. Eto polnaua hueta - udali ego fpizdu i uzay ogra.

 

 

S uvajeniem.

takashi
Evangelist
  • July 24, 2014
Hi,

 

 

Which version of FME are you using?

 

The ListConcatenator in FME 2014 SP2 concatenates all the existing elements of a list even if there are some missing elements.

 

FME 2013 SP4 didn't.

 

 

Takashi

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • July 24, 2014
You can use the XMLFragementer on this

 

I added another tag around your sample like this:

 

<tst>

 

<aspects>

 

<a id="1" l="de" v="ONE"/>

 

<a id="2" p="5" code="6"/>

 

<a id="3" p="10" code="3"/>

 

<a id="39" l="de" v="TWO"/>

 

<a id="41" l="de" v="THREE"/>

 

<a id="57" l="de" v="FOUR"/>

 

</aspects>

 

</tst>

 

then used xmlfragementer with elements to match  tst and descendant aspects.

 

This creates a list of all the row's (the a's).

 

 

I exposed the list a{}.v

 

If u now try to concatenate, it wil, as u said stop at "ONE".

 

 

But if you use listsorter first, alphabetic it will listocncatenate all

 

aspects.TWO.THREE.ONE.FOUR (sorted decreasing)

 

aspects.FOUR.ONE.THREE.TWO (sorted increasing)

 

 

but now it will not concatenate the numbers of course.

 

 

 

This is indeed like Takashi said: i am using fme 2013 sp2...

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • July 24, 2014
Yes, sort but be content or add the missing values with blanks or  Null value.

Forum|alt.badge.img
Thanks for your help. I only needed to add the sorter!

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings