Questions tagged [xml-serialization]

This tag refers to serialization technologies which use XML as a data format.

This tag refers to serialization technologies which use XML as a data format. In the context of .NET, it refers to the XmlSerializer class, less so to the DataContractSerializer class, still less to the SoapFormatter class.

4687 questions
2
votes
5 answers

Simple C# Xml Serialization

I have a class: public class Car { public string Model {get;set;} public string SeatFinish {get;set;} public string Audio {get;set;} } I want to use XML serialization attributes to serialize it to the following xml
GreyCloud
  • 3,030
  • 5
  • 32
  • 47
2
votes
1 answer

XmlSerializer cannot deserialize XML that was serialized with the same serializer

I have a strange problem using XML Serializer. If the serialized object graph contains a string with a Form-Feed (0x0C) the serializer can serialize it properly, but it cannot deserialize the serialized representation. Here is the proof of…
Gerhard77
  • 21
  • 3
2
votes
1 answer

Effect of transport encoding on XML encoding and character references

This question involves the interplay between the XML 1.0 and HTTP 1.1 recommendations. I have a web service that accepts a well-formed XML 1.0 document, parses it, and re-serializes it back to the client. The service supports both Content-Type…
Parker
  • 7,244
  • 12
  • 70
  • 92
2
votes
1 answer

Boost serialization compiling issue

I am using boost serialization on windows, and I wanted to test my code on linux (ubuntu) and unfortunately it does not compile. #include #include #include #include…
0x26res
  • 11,925
  • 11
  • 54
  • 108
2
votes
3 answers

C# - XML deserialization - ignore elements with attribue

I need to deserialize some xml to c# objects. This is my class: [XmlRoot("root")] [Serializable] public class MyRoot { [XmlElement("category")] public List Categories { get; set; } } I'm deserializing like this: root =…
petros
  • 705
  • 1
  • 8
  • 26
2
votes
1 answer

Should I store serialized (to xml) object in SharePoint list?

A requirement of my website is that I pull down data from external sources. To pull down the data, I have created a timer job (SPJobDefinition). In this job, I need to store the external data somewhere. First I was thinking I would just store it in…
TehOne
  • 2,569
  • 3
  • 26
  • 36
2
votes
1 answer

Nested objects not serialized in xml file

Here is my model I use to keep serialized data.. When I run main properties (name, surname..) set fine from xml but bot the nested objects (exam) the attributes (id, date, comment) are null inside of it What in the code gives way this…
TyForHelpDude
  • 4,828
  • 10
  • 48
  • 96
2
votes
1 answer

XML deserialization into different class?

My goal is to loosely connect two applications using XML data transfer. I can easily serialize and deserialize in XML format. But can I serialize from class in App1 and deserialize in different class (with the same structure as original one) in…
miroxlav
  • 11,796
  • 5
  • 58
  • 99
2
votes
1 answer

Msg 6522 "Cannot load dynamically generated serialization assembly" doing XML Serialization

I have a SQLCLR Function that serializes an object as XML that works fine on my local development machine (and our other DBA's machine as well), but when I try and run the same function on our test database server, I get the following: Msg 6522,…
randomsolutions
  • 2,075
  • 1
  • 19
  • 22
2
votes
1 answer

C#, problem mixing Xml Serialization with Nhibernate

I am working on a program that uses Nhibernate to persist objects, and Xml Serialization to import and export data. I can't use the same properties for collections as, for example, Nhibernate needs them to be Ilists, because it has it's own…
2
votes
1 answer

How do you avoid creating multiple instances of an object with XML Deserialization?

I've got a class that when serialized to XML looks like this (generalized for simplicity): data more data
Flynn1179
  • 11,925
  • 6
  • 38
  • 74
2
votes
1 answer

IXmlSerializable dictionary in C# without 'Key'/'Value' nodes

I'm trying to serialize a dictionary in C#. All the examples I've been able to find create XML like the following: myFirstKey myFirstValue
Sarah Vessels
  • 30,930
  • 33
  • 155
  • 222
2
votes
3 answers

XmlSerialization throwing error when deserializing?

I am trying to serialize an object into the database using xml serialization, however when deserializing it I am getting an error. The error is There is an error in XML document (2, 2) with an inner exception of " was not…
Rachel
  • 130,264
  • 66
  • 304
  • 490
2
votes
1 answer

Dump SQL Server to XML?

In mysql, you can use mysqldump --xml to dump to XML. How do you dump a SQL Server database? Preferably to XML.
Joseph Turian
  • 15,430
  • 14
  • 47
  • 62
2
votes
1 answer

.NET 4.x has breaking change: Release mode does NOT execute static initializers properly if first call is to default ctor during deserialization

First, I do understand that static initializers can be called in different sequences... that the only guarantee is that they will be executed prior to the first use of any member of that class. What I am saying is that in Release Mode of .NET 4.x…