Skip to main content
Question

XML Structure using XML Templater

  • October 19, 2020
  • 1 reply
  • 5 views

nicolae.soare
Participant
Forum|alt.badge.img+3

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

 

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

jkr_wrk
Influencer
Forum|alt.badge.img+35
  • 424 replies
  • 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?