Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Formatting Raw XML - Microsoft .Net Framework

RSS
Modified on Fri, Mar 20, 2009, 9:05 AM by Administrator Categorized as XML, XSL, and XPath, ·Net Framework
public static string FormatRawXml(string xmlText)
{
	try
	{
		XmlDocument doc = new XmlDocument();
		doc.LoadXml(xmlText);
		StringWriter stringWriter = new StringWriter();
		XmlTextWriter xmlWriter = new XmlTextWriter(stringWriter);
		xmlWriter.Formatting = Formatting.Indented;
		xmlWriter.Indentation = 4;
		xmlWriter.IndentChar = ' ';
		doc.WriteContentTo(xmlWriter);
		return stringWriter.ToString();
	}
	catch (Exception ex)
	{
		LibSystem.Diagnostics.ExceptionHandler.Show(ex);
		return "";
	}

}

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.