Skip to main content
Solved

What am I doing wrong with the XSD driven XML writer. The resulting XML is empty.

  • February 27, 2023
  • 2 replies
  • 22 views

hasant1973
Contributor
Forum|alt.badge.img+3

Hi, I'm trying to understand XSD Driven XML Writer and wrote a simple example that reads 3 CSV file with customer and address data and write a xml file containing all of the feature types.

The resulting xml is empty when I run the whole process. Running "customers" only writes at least the top element into the xml.

I connected all feature types with xml_parent_id and xml_id together.

Unfortunately the error message is saying nothing that would help me to find my problem.

 

Please help me with providing a information or repairing my work sheet.

I could also not find any example for this problem.

 

Best answer by markatsafe

@hasant1973​ Thanks for including a sample dataset and workspace. You're very close.

The xml_id must be unique for the entire dataset. FME will use those to make the associations between the objects. If you already have an id (custid) then you can use a prefix to make it unique - i.e.

customer-@Value(custid)

The deepest nested object (address) doesn't need an xml_id as nothing points back to it.

I've attached a slightly revised workspace (FME 2022.2)

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.

2 replies

Forum|alt.badge.img+2
  • 1891 replies
  • Best Answer
  • February 27, 2023

@hasant1973​ Thanks for including a sample dataset and workspace. You're very close.

The xml_id must be unique for the entire dataset. FME will use those to make the associations between the objects. If you already have an id (custid) then you can use a prefix to make it unique - i.e.

customer-@Value(custid)

The deepest nested object (address) doesn't need an xml_id as nothing points back to it.

I've attached a slightly revised workspace (FME 2022.2)


hasant1973
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • 18 replies
  • February 28, 2023

@hasant1973​ Thanks for including a sample dataset and workspace. You're very close.

The xml_id must be unique for the entire dataset. FME will use those to make the associations between the objects. If you already have an id (custid) then you can use a prefix to make it unique - i.e.

customer-@Value(custid)

The deepest nested object (address) doesn't need an xml_id as nothing points back to it.

I've attached a slightly revised workspace (FME 2022.2)

Oh, I completely miss understood the documentation. It works now. Thanks a lot.