Question

How to concatenate list when attribute values are missing?


Badge
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.
Userlevel 2
Badge +17
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
Badge +3
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...
Badge +3
Yes, sort but be content or add the missing values with blanks or  Null value.
Badge
Thanks for your help. I only needed to add the sorter!

 

 

Reply