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
1 answer

NO_MODIFICATION_ALLOWED_ERR: An attempt is made to modify an object where modifications are not allowed

Hello I am getting NO modification allowed when trying to add a new node to an xml file and I am not sure why because I am using the same code for another file and it works fine, here is the code: public void addStockItem(String itemStr, int…
JustMe
  • 289
  • 3
  • 10
2
votes
1 answer

Jackson add wrapper based on field values

I have a class like below: @JsonRootName("ASSETS") public class Assets{ String val1; String val2; } Unfortunately I need to serialize it to something like this: x
Steve
  • 4,457
  • 12
  • 48
  • 89
2
votes
2 answers

Serialize 0-n elements inside another element

I have two classes like this: public class Product { public string Name { get; set; } public int Id { get; set; } } public class Category { public string CategoryName { get; set; } public List Products { get; set; } } Is…
Kjensen
  • 12,447
  • 36
  • 109
  • 171
2
votes
1 answer

Add new XML elements and still read older versions of an XML document

In version 1 of my application I have an XML document that looks like this: black With an element that I serialize and deserialize like this: [XmlElement("background")] public string XMLbackground…
Dan
  • 91
  • 1
  • 3
2
votes
2 answers

reduce xml markup for wcf dictionary type

I am developing a WCF method that returns object data, including a Dictionary property. The XML contains a large amount of markup and I was wondering if there was means of reducing the markup. Below is an example of the current XML output for the…
Peppermintology
  • 9,343
  • 3
  • 27
  • 51
2
votes
2 answers

Controlling the "minOccurs", "maxOccurs" and "use" attributes in a type definition in the WSDL generated for an ASP.NET Web Service?

Is there any way to control the minOccurs and maxOccurs attributes of the definition of an element, or the use attribute of the definition of an attribute, in the WSDL generated for an ASP.NET Web Service? I know it is possible to do this using…
isekaijin
  • 19,076
  • 18
  • 85
  • 153
2
votes
1 answer

Xml Deserialization not recognising generated proxy derived classes

I'm having severe headaches trying to deserialize an XML into an auto-generated proxy class with derived types. This is my scenario (working with Xml.Serialization) One WCF 4.0 service sharing (as part of the contract) these…
2
votes
0 answers

XML Serialization and nullable attributes

I am working on project which needs to get xml file of a table in our database. As I am working on asp.net core on backend, I need to query on database and serialize to xml and return response. As per my Code below I got the following…
leo-boy
  • 77
  • 3
  • 8
2
votes
1 answer

OnDeserialized with xml serialization

I've been trying to implement the OnDeserialized attribute in a method inside a class. After I deserialize the class with XmlSerializer the method is never called. Is OnDeserialized method called even when the serialized class is a member property…
Arturo Martinez
  • 3,737
  • 1
  • 22
  • 35
2
votes
1 answer

XMLSerializer skips element values

I've got some Javascript code which serializes the entire DOM tree as follows: (new XMLSerializer()).serializeToString(document) But what I get is somewhat different than I'd expect. Specifically, I get the HTML source, but not the values of the…
pktm
  • 23
  • 4
2
votes
4 answers

XMl deserializer in C#

I have the following XML, and I only want to deserialize the streams of Product1, what would be the syntax in C#? Thanks. I couldn't find any documentations online. - product1
RKM
  • 3,151
  • 9
  • 37
  • 50
2
votes
0 answers

Deserialize XML into C# Model with CDATA

I'm Deserializing following XML to a C# Object
Yohan
  • 379
  • 1
  • 5
  • 14
2
votes
3 answers

Is there an implementation of an XElement or XDocument which uses dynamic?

I'm wondering if there is a built-in or open-source implementation of DynamicXml? Something like var djson = System.Web.Helpers.Json.Decode(jsonText); int id = djson.Id; but for xml strings. So rather than write xitem.Element("SomeElement") I'd…
Scott Weinstein
  • 18,890
  • 14
  • 78
  • 115
2
votes
1 answer

Dependencies & Xml Serialization

In a personal application i work on at the moment i have global application settings which should affect how certain objects behave, in terms of architecture i figured it would create an unnecessary dependency to directly reference them, e.g. public…
H.B.
  • 166,899
  • 29
  • 327
  • 400
2
votes
1 answer

XmlSerializer generates wrong order of repeated sequence

When I have a repeater on a xsd:sequence for example: This would be the matching xml: e1 n1
i1
e2
nulldevops
  • 396
  • 3
  • 15