Skip to main content

We are using FME 20222.2 and have created a worskspace to translate an input GML file into a proprietary XML format using a XSLTProccessor. It works as expected.

imageWe wanted to add a similar translation to transform an excel file into the same proprietary XML format. However, that requires XSLT 2.0 and it seems the XSLTProcessor only supports XSLT 1.

How can we construct an XML based on an XSD and complete the attributes from an Excel file ?

Is there some demo/example somewhere ? I didn't find one.

Hi @ivl​ thanks for your question! I am not familiar myself with this process but a colleague of mine suggested that you should use XMLTemplator > Template > Generate tool, but even better would be to use the the XSD-Driven XML Writer. Another method that looks similar to what you are looking for is XMLSampleGenerator. We also have an article for how to consume and produce XSD-Driven XML.

 

If you could provide some sample data we could have a better understanding of what you are doing as well. Hope this helps in the meantime!

Happy FMEing, Evie


We managed to get the correct xml content using a XMLTemplator.

imageNext, we need to send it by mail as attachment. The filename should come from _OutputFile attribute in the creator. It's calculated from the Excel source file, replacing the .XLSX extension with .XML.

 


When adding an XML writer, the created file contains unexpected characters. :

<userData>

instead of

<userData>

Why is that the case, and how can we avoid that ?

When adding a Text writer instead, the created file is correct. However, we can't find how to make the file name inherit from the source file name. We have created an attribute _OutputFile in the creator transformation as shown above. It calculates the target path/file name for the Text writer by replacing the .XLSX extension of the Excel source file by .XML.

How can we get the Text writer to use this attribute as its output file name ?

Is there a way to update a user parameter from an attribute ?


Reply