Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions dotnet/src/dotnetframework/GxClasses/Helpers/XMLHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ public static T Deserialize<T>(Type TargetType, string serialized, string sName,
{
using (StringReader sr = new StringReader(serialized))
{
deserialized = (T)(xmls.Deserialize(sr));
using (XmlReader xmlReader = XmlReader.Create(sr, new XmlReaderSettings {CheckCharacters=false }))
{
deserialized = (T)(xmls.Deserialize(xmlReader));
}
}
}
catch (InvalidOperationException ex)
Expand Down Expand Up @@ -163,13 +166,14 @@ internal static string Serialize(string rootName, string sNameSpace, XmlAttribut
string s;
using (MemoryStream stream = new MemoryStream())
{
XmlWriter xmlw = XmlWriter.Create(stream, new System.Xml.XmlWriterSettings()
XmlWriter xmlw = XmlWriter.Create(stream, new XmlWriterSettings()
{
OmitXmlDeclaration = !includeHeader,
Indent = indentElements,
IndentChars = "\t",
Encoding = Encoding.UTF8
});
Encoding = Encoding.UTF8,
CheckCharacters = false
});
XmlSerializerNamespaces xmlns = new XmlSerializerNamespaces();
xmlns.Add(string.Empty, sNameSpace);
xmls.Serialize(xmlw, instance, xmlns);
Expand Down