Loading an "XmlDocument" into the editor.

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by James Walsh
Hello. I just started using the editor and I love it.

What is the proper way to pass a .NET "XmlDocument" into the editor? I have the editor set up so that I can paste xml into it and the highlighting works. When I call "editor.Document.AppendText(XmlDoc.OuterXml)", the xml is added to the editor, but it loses all indenting and appears on only one line. Is there some other way I need to interact with the editor, or am I misusing "XmlDocument"?

Thanks for any help,


Comments (2)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Hi James,

SyntaxEditor isn't indenting/formatting the XML so it's the output from the XmlDocument itself that is producing the one line stream of tags. I remember that from using XmlDocument myself in the past. I know that the XmlTextWriter class has props for controlling XML indentation. Maybe use that instead.

Actipro Software Support

Posted 19 years ago by James Walsh
Thanks. Your reply led me to a fresh investigation of the problem. It turns out that setting "_xmlDoc.PreserveWhitespace = true" was all I needed.
The latest build of this product (v24.1.0) was released 4 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.