Questions tagged [xml-deserialization]

XML Deserialization is the process of re-creating an in-memory object from its serialized state which used XML as a data format.

1004 questions
3
votes
1 answer

Deserialize Comments using Custom IXmlSerializer

I am attempting to serialize my Description property to an Xml comment. So, to do this I have implemented IXmlSerializable and the following WriteXml produces very nice XML. [Serializable] public sealed class Setting : SettingBase,…
MoonKnight
  • 23,214
  • 40
  • 145
  • 277
3
votes
2 answers

C# XML Deserializing Error (2,2)

School gave me an XML document, and I have to display the information on a screen. As far as I know, Xml Deserialization would be the easiest/nicest solution. I have this so far: public static List ProjectListDeserialize(string path) { …
Jordy Langen
  • 3,591
  • 4
  • 23
  • 32
3
votes
3 answers

Is it possible in XSL to flatten XML hierarchy?

I have the following structure to XML file:
user53885
  • 3,809
  • 11
  • 33
  • 43
3
votes
1 answer

Issue with using XmlSerializer

Here is my C# code: public static T Deserialize(string input) where T : class { System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(T)); using…
3
votes
1 answer

C# can't deserialize XML containing xsi:type

I am trying to deserialize the following XML 2.0
Endri
  • 714
  • 13
  • 34
3
votes
0 answers

ignore xml-attribut when deserialising

I receive from two different systems an xml which I have to deserialise with c#. Both xml should be the same but unfortunately they are slightly different and there is no way for me take influence on the systems how they create the xml. xml1
CaptainInler
  • 157
  • 1
  • 9
3
votes
1 answer

Symfony3: XML deserialize array

The Symfony 3.4 documentation states the following for deserializing arrays: use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer; use…
Appyapp
  • 31
  • 1
  • 4
3
votes
1 answer

Deserialize Xml Properties depending from attribute value

I try to deserialize this xml: 10000 DE10000 22222
Kris
  • 512
  • 7
  • 16
3
votes
1 answer

Deserialization with Axis 2

I have some Java code that takes an XML (SOAP) message and returns the deserialized object: public static T deserializeObject(String xml, Class clazz) throws AxisFault, Exception { assert xml != null : "xml != null"; assert clazz !=…
kiwifrog
  • 764
  • 3
  • 10
  • 23
3
votes
1 answer

XML attribute with namespace other than its parent's is deserialized as null

I'm trying to deserialize following XML: Notice the namespace of the attribute is different than namespaces of…
Sushi271
  • 544
  • 2
  • 8
  • 22
3
votes
1 answer

Xml Deserialization - after unknown node in xml-data, all fields remain empty

i want to deserialize a xml-string to an object using XmlSerializer. The xml-string contains additional unknown nodes, which are not covered by my object-class i want to deserialize to. After deserialization, fields before the unknown node are…
hc2p
  • 188
  • 1
  • 11
3
votes
3 answers

Unable to deserialize an XML string

I have the following xml which I'm trying to deserialize as follows but I get error: There was an error reflecting type 'System.Collections.Generic.List`1[MyApp.Models.Field] Below is my code public class FieldList { [XmlArray("fields")] …
adam78
  • 9,668
  • 24
  • 96
  • 207
3
votes
1 answer

Deserializing an XML into a object: XML element with xsi:nil="true" should have null value (and not empty value) for respective property in object

When de-serializing the below XML into Parent class, ElementTwo and ElementThree are empty strings, which is expected. But ElementOne should have been null but instead this is also empty string. What does i:nil="true" mean? XML
3
votes
2 answers

Convert XML string to List without specifiying Element Root in C#

I need to convert the XML string to List, the method should be generic. I wrote a method but its not performing as expected. Scenario: #1 Model Class: public class Employee { public int EmpId { get; set; } public string Name { get; set;…
user7784919
3
votes
1 answer

Deserialize an XML using XMLSerializer

I'm trying to deserialize an XML file with XmlSerializer. However i am getting this exception: There is an error in XML document (1, 41).InnerException Message "ReplicationStatus xmlns='DistributionServices' was not expected." The XML file looks…
Shelly Tomar
  • 185
  • 1
  • 10