Loading an "XmlDocument" into the editor.

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by James Walsh
Avatar
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,

James

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
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 14 years ago by James Walsh
Avatar
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 (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.