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.[Modified at 10/27/2005 02:26 PM]
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();
doc.Load(@"D:\data\test.xml");
MemoryStream tempXML = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(tempXML,Encoding.UTF8);
writer.Formatting = Formatting.Indented;
doc.Save(writer);
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?
this.syntaxEditor1.Document.LoadFile(tempXML,Encoding.UTF8);