Logic Apps standard — XML transformation issue

Vinnarason James
2 min readOct 30, 2021

--

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.

Issue:

When xml result is generated and sent to the target system, target system generated an error when processing the file.

Error:

XML marshalling error: Content is not allowed in prolog

XML message:

�<?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.

Solution:

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.

Transform xml action — Transform option

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.

--

--

Vinnarason James
Vinnarason James

Written by Vinnarason James

An Azure Enthusiast, looking to share my learning about Azure Services I use as part of my job

No responses yet