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
2 answers

XmlSerializer - Same Element with different Attributes

Expected XML Output: 1 MyName1 2 MyName2 3
Gopi
  • 5,656
  • 22
  • 80
  • 146
2
votes
1 answer

C#: XML Deserialize limitation

I'm kinda newbie with XML serial/deserialize things and tyring to write some Generic classes. While using XmlSerializer.Deserialize(typeof(T)), I realize that T object should have the same name as that of the Parent element in my XML. Here is the…
Farrukh Waheed
  • 2,163
  • 2
  • 29
  • 59
2
votes
2 answers

Renaming array items in a flat xml array using an XmlSerializer

I have an XML file with the following format: I need to read the elements as objects of class MyClass…
xmlWiz
  • 23
  • 3
2
votes
0 answers
2
votes
2 answers

Deserializing XML arrays

I have an xml file I'm trying to deserialize using the .Net XmlSerializer class. I'm having trouble coming up with a C# class that represents the xml format. My main problem is dealing with one element that's used to represent a generic array. The…
Tony
  • 21
  • 2
2
votes
1 answer

Serializing and Deserializing strings containing Hex characters

I am reading this file and using the System.Xml.Serialization.XmlSerializer to serialize and deserialize. Sorry I am unable to post the contents of the file in this question as StackOverflow is encoding them incorrectly. The Deserialize function is…
Praveen Reddy
  • 7,295
  • 2
  • 21
  • 43
2
votes
3 answers

How would I achieve the following XmlSerializer change for my class in C#?

I want to produce the following XML: Joe Jack From the classes: public class Base { public List children; …
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
2
votes
1 answer

Whether to use the XML Serialization or simple LINQ to XML for XML database in windows phone 7?

I am developing window phone 7 application. I am new to the window phone 7 application. I am also new to the XML Serialization & LINQ to XML. I am using XML as database for my current application. I found that I have two options to store & retrieve…
2
votes
3 answers

XML Serialization: How to distinguish classes that use the same element name but have a different value in an attribute?

The title may be long, let me explain what I mean. I won't give you the actual XML that I need to work with, but I'll give one that demonstrates the issue I'm facing. I have an XML that looks like this:
Venemo
  • 18,515
  • 13
  • 84
  • 125
2
votes
2 answers
2
votes
1 answer

how to customise default Boost xml Serialisation default node naming to make it more readable

The code below generates a xml file but , when it loops theough a map , it always names the map key as first and value as second Is there a way that we can customise tag names first and second to groupid and groupType as shown in desired output …
2
votes
1 answer

XML Serialized from xsd.exe generated code using substitution groups is invalid (invalid xsi:type error)

I've generated some C# classes from some 3GPP XSDs (multiple XSD files/namespaces) and it works great for serialization apart from one problem with concrete instances of an abstract type used in a substitution group. Firstly, the relevant parts of…
zeroid
  • 701
  • 7
  • 19
2
votes
2 answers

Using C# xmlserializer on derived classes while controlling the generated XML element

I've got a C# structure of classes with an abstract base class and various classes derived from this abstract class. [System.Xml.Serialization.XmlInclude(typeof(B))] public abstract class A { ... } [Serializable] [XmlType("typename")] public class…
flo
  • 49
  • 1
  • 5
2
votes
1 answer

Convert DataSet with relations to nested json

I am using c# and i have a DataSet (ds) with 2 Datatables (dt1,dt2) having relations to each other. Now i want to convert the Dataset to a nested json string. Option1: string myresult = JsonConvert.SerializeObject(ds); Using this creates a…
Schauby
  • 172
  • 2
  • 16
2
votes
1 answer

Serializing to XML file creates invalid XML document (11,12)

I'm trying to save a class into an XML Document. The class looks Like this: public class Settings { public LDAP LDAP; public Miscellaneous Miscellaneous; } public class LDAP { public bool LoadLDAPData; public bool…