Net Standard xml writing more consistent with crestron behaviour

This commit is contained in:
Chris Cameron
2017-10-12 11:53:35 -04:00
parent a499a97cf6
commit b73b2de5ee

View File

@@ -43,7 +43,7 @@ namespace ICD.Common.Utils.Xml
#if SIMPLSHARP
: this(new XmlTextWriter(textWriter.WrappedTextWriter))
#else
: this(XmlWriter.Create(textWriter.WrappedTextWriter))
: this(XmlWriter.Create(textWriter.WrappedTextWriter, GetSettings()))
#endif
{
}
@@ -128,15 +128,22 @@ namespace ICD.Common.Utils.Xml
#if STANDARD
private static XmlWriterSettings GetSettings(Encoding encoding)
{
XmlWriterSettings output = GetSettings();
output.Encoding = encoding;
return output;
}
private static XmlWriterSettings GetSettings()
{
return new XmlWriterSettings
{
Encoding = encoding,
ConformanceLevel = ConformanceLevel.Fragment,
Indent = true
};
}
#endif
#endregion
#endregion
}
}