Geeks With Blogs


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done

Original Article:

Is there a simple way to indent xml with dotnet? SQL Server returns a long xml string that is hard
> to read.[/color]

XmlReader r = new XmlTextReader(new StringReader(myXML));
StringWriter sw = new StringWriter();
XmlTextWriter w = new XmlTextWriter(sw);
w.Formatting = Formatting.Indented;
while (r.Read())
w.WriteNode(r, false);
Oleg Tkachenko [XML MVP]

Posted on Monday, August 11, 2008 2:09 AM XML & Datasets | Back to top

Comments on this post: indent xml with .NET

# re: indent xml with .NET
Requesting Gravatar...
What a great post, was very interesting and very helpful.
Left by canvas prints on Sep 23, 2011 10:17 AM

Your comment:
 (will show your gravatar)

Copyright © Rodney Vinyard | Powered by: