File tree Expand file tree Collapse file tree
Microsoft.VisualBasic.Core/src/Text/Xml/Linq Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ Namespace Text.Xml.Linq
110110 Return xml.Replace( $"xmlns=""{ReplaceXmlns}""" , "" )
111111 End Function
112112
113+ Const xsi As String = "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"""
114+
113115 ''' <summary>
114116 ''' This method have bugs when deal with the xml when it have
115117 ''' multiple xml namespace value
@@ -118,9 +120,10 @@ Namespace Text.Xml.Linq
118120 ''' <returns></returns>
119121 Public Function LoadXml(xml As String , Optional variants As Type() = Nothing ) As T
120122 Call sb.Clear()
121- Call sb.AppendLine( "<?xml version=""1.0"" encoding=""utf-16"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" ?>" )
123+ Call sb.AppendLine( "<?xml version=""1.0"" encoding=""utf-16""?>" )
122124 Call sb.AppendLine(process(xml))
123125
126+ ' removes of the default namespace definition, otherwise, the deserialization process will fail
124127 If Not ReplaceXmlns.StringEmpty Then
125128 Call sb.Replace( $"xmlns=""{ReplaceXmlns}""" , "" )
126129 End If
You can’t perform that action at this time.
0 commit comments