Question

Merge and match list attributes

  • 6 December 2016
  • 2 replies
  • 6 views

I have a XML that i want to take out 2 values, name and title.

i have done it here;

Now I have these attributes but now i dont know how i do to match layer title and layer name.

I would just want 2 attributes one for name and one for title

I have worked on this for a while and Icant get any closer to the result i want.

Attach the workspace.


2 replies

Userlevel 4
Badge +25

The simple answer is to add two ListExploder transformers. In the first select Layer.Layer{} to explode, and in the second select Layer{}. That will give you 23 features, each of which has a name and title.

You might need to do a bit of cleanup, but should essentially be it.

But I think there should be another option - the Flatten Options in the reader, where you could click the Advanced button and pull out the information directly. But I'm not sure off hand exactly how to do that. If you can't get the ListExploders to work then let me know and I will look into that some more.

Badge +16

Possibly using 2 readers on 2 different elements to match or one reader pointing to 2 elements might result in easier to map list elements, but that is possible to investigate if a sample of the XML data can be provided.

And yes flattening is always advised as @Mark2AtSafe mentiones

Reply