Skip to main content
Hi All

XML Format as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Flows><SCN>
<SystemCodeNumber>N11111J</SystemCodeNumber>
<FlowType>Scoot</FlowType>
<ShortDescription/>
<Northing>0.00</Northing>
<Easting>0.00</Easting>
<Flows>
<Flow Date="2015-05-03 05:08:35">1.0</Flow>
<Flow Date="2015-05-03 05:13:35">4.0</Flow>

etc.

I am accessing an XML file as a single merged feature type as i would like an output as follows:

SystemCodeNumber,Northing,Easting,Speed,Flow,Date

N11111J,0.00,0.00,,1.0,2015-05-03 05:08:35

N11111J,0.00,0.00,,4.0,2015-05-03 05:13:35

N11111J,0.00,0.00,,1.0,2015-05-03 05:18:35

N11111J,0.00,0.00,,0.0,2015-05-03 05:23:35
as so on.

I am getting the elements i want:


and flattening the elements:

not the output is fine, im getting what i require out:


I have my SystemCodeNumber, Easting and Northing out. I would like to add them as i one to many so i can get my output as required. At the moment im testing to see if the attribute exists and storing it in a VariableSetter and Retrieving it before writing.

What im trying to figure out (without having to go down the python route as i can do it in python is if we have a simpler way to do this?

Thanks

Hi,
try setting "SCN" to the Elements to Match parameter. Values of the attribute "Flows/Flow/@Date" will be stored in a list attribute called "Flows.Flow{}.Date". You can then explode features on "Flows.Flow{}" with the ListExploder.
However, I'm not sure how the "Speed" should be treated, since "Speed" elements are not shown in your sample XML doc.
Takashi
Hi,
try setting "SCN" to the Elements to Match parameter. Values of the attribute "Flows/Flow/@Date" will be stored in a list attribute called "Flows.Flow{}.Date". You can then explode features on "Flows.Flow{}" with the ListExploder.
However, I'm not sure how the "Speed" should be treated, since "Speed" elements are not shown in your sample XML doc.
Takashi

Hi Takashi. Apologies, the Speed element gets added in a FeatureMerger later in the workbench.

I will give your advice a go and let you know, thanks for your reply.


Hi Takashi. Apologies, the Speed element gets added in a FeatureMerger later in the workbench.

I will give your advice a go and let you know, thanks for your reply.

OK. In addition, to improve performance, it's better to remove unnecessary attributes before exploding.


Hi

I have done the following:

And this is the output. I have lost the list but thats not an issue. I would like the fields that have attributes from SystemCodeNumber, Easting, Northing to replicate to all the rows ie 1toM?


OK. In addition, to improve performance, it's better to remove unnecessary attributes before exploding.

looks okay but the issue is with replicating the SCN,X,Y, into all rows?


looks okay but the issue is with replicating the SCN,X,Y, into all rows?

This is my settings and the result from your sample XML. Isn't the resulting table your desired one?


Reply