Skip to main content
Question

XML Structure using XML Templater

  • October 19, 2020
  • 1 reply
  • 3 views

nicolae.soare
Forum|alt.badge.img+2

Hi,

I am quite new to XML and I would like to generate xml structured file using FME.

For input I have a simple csv file with 3 columns:LOCALITATE (tanslation: Locality), STRADA (translation: Street) and NR (Translation: Number).

Desired structure should be something like:

<localitati>

<localitate>Buftea</localitate>

<strada>Parului</strada>

<nr>1</nr>

<nr>2</nr>

<nr>3</nr>

<strada>Independentei</strada>

<nr>4</nr>

<nr>5</nr>

<nr>6</nr>

......

<localitate>Mogosoaia</localitate>

<strada>Printipala</strada>

<nr>11</nr>

<nr>12</nr>

<nr>13</nr>

</localitati>

 

I used FME to read my CSV, added an XMLTemplater to obtain my desired xml.

After I properly(maybe?) set all parameters, it doesn't seem to group NR by STREET. Instead, it is placing all numbers for each street in each Locality.

 

I attached workspace + input and output data.

Can you give me some help in telling me where I am making the mistake?

 

Thank you!

nicu

 

 

 

1 reply

jkr_wrk
Influencer
Forum|alt.badge.img+28
  • October 19, 2020

I think what you are looking for is the SUB-template, combined with the "group sub features by" setting.

Maybe you need to do this for every layer of data. So two xmltemplaters: one for the 'street' and one for the 'locality'. But I did not look at your workbench or data. So maybe I'm wrong.XML Sub Templater 

 

I hope the image above will give you a clue to figure it out?


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