J
Julie
Hi everyone,
I have a question about XmlSerializer. I have some code that serializes an
object to xml, but it has all the whitespace and new lines in the output.
How do i remove these?
Thanks in advance.
Public Shared Function Serialize(ByVal options As OptionsData) As String
Try
Dim loSerializer As Xml.Serialization.XmlSerializer
Dim loStringWriter As System.IO.StringWriter
Dim lsResult As String = String.Empty
If Not options Is Nothing Then
loSerializer = New
Xml.Serialization.XmlSerializer(options.GetType)
loSerializer.Serialize()
loStringWriter = New System.IO.StringWriter()
loSerializer.Serialize(loStringWriter, options)
loStringWriter.Flush()
lsResult = loStringWriter.ToString
loStringWriter.Close()
End If
Return lsResult
Catch ex As Exception
Throw ex
End Try
End Function
I have a question about XmlSerializer. I have some code that serializes an
object to xml, but it has all the whitespace and new lines in the output.
How do i remove these?
Thanks in advance.
Public Shared Function Serialize(ByVal options As OptionsData) As String
Try
Dim loSerializer As Xml.Serialization.XmlSerializer
Dim loStringWriter As System.IO.StringWriter
Dim lsResult As String = String.Empty
If Not options Is Nothing Then
loSerializer = New
Xml.Serialization.XmlSerializer(options.GetType)
loSerializer.Serialize()
loStringWriter = New System.IO.StringWriter()
loSerializer.Serialize(loStringWriter, options)
loStringWriter.Flush()
lsResult = loStringWriter.ToString
loStringWriter.Close()
End If
Return lsResult
Catch ex As Exception
Throw ex
End Try
End Function