Using msxml 6.0 /c++, generated XML output contains indent characters '\r\n' I needed '\n' only

Vijay Singh 21 Reputation points
2021-10-07T03:54:24.343+00:00

I am using MSXML6 to write xml data using C++ code is

IMXWriter* m_pWriter;
ISAXContentHandler* m_pContentHandler;
(CoCreateInstance(__uuidof(MXXMLWriter60), NULL,
CLSCTX_INPROC_SERVER, __uuidof(IMXWriter),
reinterpret_cast<void**>(&m_pWriter))

m_pWriter->QueryInterface(__uuidof(ISAXContentHandler,
reinterpret_cast<void**>(&m_pContentHandler))
m_pWriter->put_indent(VARIANT_TRUE)**

After setting put_indent(VARIANT_TRUE) generated output contains characters "\r\n" before XML opening tag and closing tag i.e.

\r\n<ItemNo>12<ItemNo>\r\n

As per my requirement indent character should be "\n" only i.e. output should be

\n<itemNo>12<ItemNo>\n.

How can this be solved?

Environment:

Visual Studio 2019 C++
MSXML 6.0
Windows 10

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,599 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,626 questions
{count} votes