Correct XML or txt with X++ in AX 2012

Hi guys.

I wanted to ask a question. Can I correct XML document in AX 2012 R3 with code and if I can, how to do it. The document can also be opened as txt file so if anyone knows how to correct / rework txt file can share knowledge as well.

BR.

Use the XMLDocument class - load() for loading from a file, save() for saving and other methods such as createElement() for manipulation. Use cross-references in AX or your favorite search engine to find some examples, if needed.

Working with text files is possible too, but it’s not what you want to do in the case of XML.

Hi Martin.

I am glad you returned my post.

I managed to rework the XML document. This post is connected to my other post http://dynamicsuser.net/forums/p/81757/452576.aspx#452576, problem with import/export of XML doc AX 2012. My idea there was that initialy I export the document with UTF-16, so I will not have the small dash in front of the XML declaration, and then I load the doc, rework the XML declaration from UTF-16 to UTF-8, and then deliver the reworked document to the client, but this did not fix the problem, I think when the method save() of the XMLdocument class is called it puts this dash in front of the XML declaration if the encoding format is UTF-8.

Thanks again. I hope you have time to answer to my other post. :slight_smile: