Logic Apps standard — XML transformation issue
Recently there was a requirement to transform a positional flat file to XML format. In Logic Apps there are few options to achieve this. Below articles can help getting started and achieving the same.
Logic App Standard — Working with Flat Files
How to transform flat files from delimited to positional or any other type of files using Logic Apps standard
Logic App Standard — Working with Flat Files — Part II
Flat file handling within Logic Apps standard itself
When xml result is generated and sent to the target system, target system generated an error when processing the file.
XML marshalling error: Content is not allowed in prolog
�<?xml version=\"1.0\" encoding=\"utf-8\"?>
<ns0:WorkOrder xmlns:ns0=\"http://xmlschema.ts/work/order\"> </ns0:WorkOrder>
There was a symbol � attached to the xml message when transforming the file using transform XML action in Logic App. This is the reason for the xml marshaling failure at the target system.
After multiple failure attempts to find and replace this symbol with regex and other symbols, decided to look at what are the options available at Logic App transform XML action.
When Disabled the byte order mark is enabled at the transform options, it removed the special mark at the result xml output. This resolved the issue at the client application and it was able to process the resultant xml successfully.