Auto linefeed/indent when loading XML?

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by Guy
I don't know if this can be done, I have looked in the documentation but found nothing. Maybe it is me or maybe it is not there. Looking for something similar to the setting of the XML writer that includes formatting options.

I have XML files that are streams (no line feed, carriage returns, tabs, formatting, etc...). When loaded into SyntaxEditor all 500 pluss characters show up on line one.

I have a work around but was wondering if there is direct support.

XmlDocument doc = new XmlDocument();

MemoryStream tempXML = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(tempXML,Encoding.UTF8);
writer.Formatting = Formatting.Indented;
tempXML.Seek(0,SeekOrigin.Begin);  // Need to return the position of the stream to beging otherwise
                                   // you get nothing! Should LoadFile do this as a safty net?
[Modified at 10/27/2005 02:26 PM]

Comments (1)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
No, not yet. We load directly whatever text you set. So if your XML text is squooshed together, you should indent it prior to displaying it in SyntaxEditor.

Once we add language-specific add-on features to SyntaxEditor, we'll probably include something like that in an XML language add-on.

Actipro Software Support

The latest build of this product (v24.1.0) was released 5 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.