All Questions

345
votes
14answers
489225 views

How to Deserialize XML document

How do I Deserialize this XML document: <?xml version="1.0" encoding="utf-8"?> <Cars> <Car> <StockNumber>1020</StockNumber> <Make>Nissan</Make> ...
129
votes
7answers
108215 views

Is it possible to deserialize XML into List<T>?

Given the following XML: <?xml version="1.0"?> <user_list> <user> <id>1</id> <name>Joe</name> </user> <user> <id>...
65
votes
2answers
109741 views

How to deserialize xml to object

<StepList> <Step> <Name>Name1</Name> <Desc>Desc1</Desc> </Step> <Step> <Name>Name2</Name> <Desc>Desc2</Desc&g...
73
votes
15answers
100409 views

How to convert an xml string to a dictionary in Python?

I have a program that reads an xml document from a socket. I have the xml document stored in a string which I would like to convert directly to a Python dictionary, the same way it is done in Django's...
43
votes
1answers
31925 views

using XmlArrayItem attribute without XmlArray on Serializable C# class

I want XML in the following format: <configuration><!-- Only one configuration node --> <logging>...</logging><!-- Only one logging node --> <credentials>...&l...
11
votes
3answers
4884 views

How to define multiple names for XmlElement field?

I have a XML document provided by client applications to my C# application. This is how a client sends the XML file: <?xml version="1.0" encoding="utf-8"?> <SomeAccount> <parentId&...
19
votes
5answers
20650 views

How do I use an XmlSerializer to deserialize an object that might be of a base or derived class without knowing the type beforehand?

In C#, how do I use an XmlSerializer to deserialize an object that might be of a base class, or of any of several derived classes without knowing the type beforehand? All of my derived classes add ad...
38
votes
7answers
27702 views

Unable to generate a temporary class (result=1). error CS0030: Cannot convert type 'Type[]' to 'Type'?

I get this error after I created a class from my xsd file using the xsd.exe tool. So I searched the net and found a solution. Here is the link: http://satov.blogspot.com/2006/12/xsdexe-generated-class...
5
votes
3answers
18532 views

fast way to deserialize XML with special characters

I am looking for fast way to deserialize xml, that has special characters in it like ö. I was using XMLReader and it fails to deserialze such characters. Any suggestion? EDIT: I am using C#. Cod...
14
votes
1answers
30798 views

How to Deserialize XML using DataContractSerializer

I'm trying to deserialize an xml document: <?xml version="1.0"?> <games xmlns = "http://serialize"> <game> <name>TEST1</name> <code...

Previous Next