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 #if SIMPLSHARP
: this(new XmlTextWriter(textWriter.WrappedTextWriter)) : this(new XmlTextWriter(textWriter.WrappedTextWriter))
#else #else
: this(XmlWriter.Create(textWriter.WrappedTextWriter)) : this(XmlWriter.Create(textWriter.WrappedTextWriter, GetSettings()))
#endif #endif
{ {
} }
@@ -128,10 +128,17 @@ namespace ICD.Common.Utils.Xml
#if STANDARD #if STANDARD
private static XmlWriterSettings GetSettings(Encoding encoding) private static XmlWriterSettings GetSettings(Encoding encoding)
{
XmlWriterSettings output = GetSettings();
output.Encoding = encoding;
return output;
}
private static XmlWriterSettings GetSettings()
{ {
return new XmlWriterSettings return new XmlWriterSettings
{ {
Encoding = encoding, ConformanceLevel = ConformanceLevel.Fragment,
Indent = true Indent = true
}; };
} }