From 171db402cc4e31418d2f751d7810c871482dfb4a Mon Sep 17 00:00:00 2001 From: PicelBoi Date: Sun, 28 Dec 2025 22:38:05 -0500 Subject: [PATCH] remove the declaration --- MistWX-i2Me/RecordGeneration/ClimatologyRecord.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MistWX-i2Me/RecordGeneration/ClimatologyRecord.cs b/MistWX-i2Me/RecordGeneration/ClimatologyRecord.cs index a6b2398..52566fb 100644 --- a/MistWX-i2Me/RecordGeneration/ClimatologyRecord.cs +++ b/MistWX-i2Me/RecordGeneration/ClimatologyRecord.cs @@ -1,3 +1,4 @@ +using System.Xml; using System.Xml.Serialization; using MistWX_i2Me.API; using MistWX_i2Me.Schema.ibm; @@ -31,14 +32,19 @@ public class ClimatologyRecord : I2Record XmlSerializer serializer = new XmlSerializer(typeof(ClimatologyRecordResponse)); StringWriter sw = new StringWriter(); + XmlWriter xw = XmlWriter.Create(sw, new XmlWriterSettings + { + OmitXmlDeclaration = true, + ConformanceLevel = ConformanceLevel.Fragment, + }); XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); ns.Add("", ""); - serializer.Serialize(sw, cliRecRes, ns); + serializer.Serialize(xw, cliRecRes, ns); sw.Close(); recordScript += $"" + - $"{result.Location.cliStn}{sw.ToString()}"; + $"{result.Location.cliStn}{xw.ToString()}"; } recordScript += "";