Use config to store settings

This commit is contained in:
2025-10-04 17:44:28 +09:00
parent 2445c23f2e
commit e80282fcd8
5 changed files with 32 additions and 5 deletions

View File

@ -0,0 +1,29 @@
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace Hcs.WebApp.Utils
{
internal static class XmlBeautifier
{
internal static string Beautify(string xml)
{
var stringBuilder = new StringBuilder();
var settings = new XmlWriterSettings
{
OmitXmlDeclaration = true,
Indent = true,
NewLineOnAttributes = true
};
using (var xmlWriter = XmlWriter.Create(stringBuilder, settings))
{
var element = XElement.Parse(xml);
element.Save(xmlWriter);
}
return stringBuilder.ToString();
}
}
}