1,021 questions
4
votes
1
answer
117
views
Deserialize XML List into FrozenSet
Given a class like this:
public class A
{
public FrozenSet<int> Foo { get; set; }
}
and this XML:
<A>
<Foo>
<int>1</int>
<int>2</int>...
2
votes
1
answer
105
views
Deserialize an XML with multiple namespaces
I am trying to deserialize an XML file with the following structure:
<file:Process xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/...
4
votes
1
answer
99
views
Deserialization of XML with multiple namespaces
I'm attempting to deserialize an XML response from an API. The data is as follows (I have only included a small chunk for the sake of a small post):
<ns1:alerts xmlns:ns1="http://gov.fema....
0
votes
0
answers
111
views
Can you remove empty elements from XML by configuring the MvcBuilder?
My ASP.NET Core 9.0 Web API with a POST method accepts XML. The post passes into my controller as a deserialised object, however empty elements in the XML content cause a problem with deserialisation. ...
0
votes
0
answers
50
views
How to handle unknown XML elements and attributes during deserialization using a partial class? [duplicate]
I'm working with XML deserialization in C#, using a partial class to map the structure of the XML. This class is generated and maintained separately, so I cannot modify its existing structure.
However,...
0
votes
0
answers
95
views
Unable to perform Jackson deserialisation for boolean and int
My XML
<Parent>
<childs>
<child>1</child>
<child>0</child>
</childs>
</Parent>
Pojo Structure is
class Parent
{
@...
0
votes
1
answer
53
views
How to programatically add an XmlAttribute declaration to a member of an existing class?
I am attempting to deserialize an XML node (from a basic text file) into an instance of an existing C# class, using the Deserialize method of the XmlSerializer. The deserialization is failing to ...
1
vote
1
answer
49
views
ASP.NET Core - Deserialize Cities API XML response not working
When calling cities API, it returns this response in XML format. I want to deserialize this XML into an object. Deserialization grabs objects till diffgram inside diffgram we have the NewDataSet ...
1
vote
1
answer
133
views
XML deserialization using XPath rather than fixed element name for a property in c#?
If I have a xml like this
<Form_1_1>
<Body>
<Code>123</Code>
</Body>
</Form_1_1>
I can easily deserialize it to this class structure
[XmlRoot("...
0
votes
1
answer
47
views
RestSharp deserialize XML node inside a parent node
I'm calling an API service that wraps all responses surrounded by a Response element:
<?xml version="1.0" encoding="UTF-8"?>
<Response xmlns="http://www.example.com/...
3
votes
1
answer
127
views
C# Convert JSON to XML with Attribute and Value
I have a json like below
{
"Title": null,
"ProjectName": {
"@Label": "Project Name",
"Value": "Test Project Name",
...
0
votes
1
answer
80
views
Problem with deserialized classes with Visual Studio
This is my first experience with the deserializer.
I'm working on an Xml file, which I don't publish because it's too large, using Visual Studio's 2019 Paste Special to create the classes.
However, a ...
1
vote
1
answer
391
views
How to Deserialize XML into C# object ignoring xmlns? [duplicate]
Given the following XMLs, how could I deserialize them to the same C# object? Version 1.1 is essentially backward compatible to 1.0 so I don't really care about the xmlns value but C# thinks otherwise....
1
vote
1
answer
165
views
Trouble Deserializing/Serializing XML with Mixed Element Order in C#
I am facing an issue while deserializing/serializing XML into a C# object. The XML structure has mixed order of elements, and I am encountering problems with elements that have the same name but ...
3
votes
0
answers
85
views
XmlSerializer deserialization UnknownAttribute event not firing for built-in types
I have an event handler for XmlSerializer's UnknownAttribute event. This fires correctly if I have the following document:
<Document>
<Test unknown="attribute">
...
...
0
votes
1
answer
84
views
Is it possible to deserialize an xml into a dictionary without using linq-to-xml?
I'd like to deserialize an xml file. Here is the xml file in question :
<MessageList category="Alarm" version="1.0.0">
<Item id="1">
<Message ...
1
vote
2
answers
101
views
XML deserialization: if two elements are present how can I bind to one in preference to the other?
I need to deserialize XML containing elements in one of the following three forms:
<Element1>xxx</Element1>
or
<Element2>xxx</Element2>
or
<Element1>xxx</Element1>...
0
votes
0
answers
70
views
String internment in Python during JSON and XML parsing
Does Python perform string internment to save memory on duplicate keys when deserializing large arrays of dicts read from XML/JSON serialized to disk? (e.g. during xml.dom.minidom.parse / json.load)
...
0
votes
0
answers
90
views
xml/json source surrogate sequence per nesting level
Semi-structure xml/json files are often used to serialize relational data from different levels of entities in a master-detail cascade fashion.
As xml/json files are ordered, unique keys are not ...
0
votes
0
answers
92
views
(De)serialization of controls with all properties
I'm trying to serialize all the attributes of a control, for starters I started with the TextEdit control of Devexpress. However, the same problem occurs with the TextBox control. Serialization passes ...
0
votes
2
answers
1k
views
XML Deserialize with Native AOT
I want to deserialize XML document to C# object.
XML document example
<XtraSerializer version="1.0" application="LayoutControl">
<property name="#LayoutVersion"...
-1
votes
1
answer
79
views
C# how to deserialize XML string which has nested same node [duplicate]
<n-hierarchy>
<n name="ABC" n_id="971" />
<n name="XYZ" n_id="972">
<n name="jkl" n_id="973">
...
0
votes
1
answer
67
views
XML contains element with the namespace as empty URI breaks deserialization
I have an XML with the following structure:
<?xml version="1.0" encoding="utf-8"?>
<ClientInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http:/...
0
votes
1
answer
953
views
Converting a Python object To XML without namespaces
I am using the XmlSerializer from xsdata to convert a python3.9 dataclass object into XML.
This is the code
# create serializer
XML_SERIALIZER = XmlSerializer(config=SerializerConfig(xml_declaration=...
1
vote
1
answer
335
views
Solving the WCF DataContract DataMember Order deserialization problem
One use case for interfacing with a legacy WCF is to hide all the .NET service code behind a more modern RESTful API to which we Post the (seemingly correct) XML, and deserialize it to the WCF class ...
2
votes
2
answers
604
views
Java - Jackson XML Deserializing by Interface/Abstract class
I have these 2 XML's that I'm trying to deserialize with jackson-dataformat-xml:
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-...
0
votes
1
answer
171
views
Java Jackson XML base64 encoded tag serializer
I'am trying to deserialize xml that contains a base64 encoded tag into an object
This is an example of the api response data :
<WebResponse>
<RequestId>6541635537</RequestId>
...
1
vote
1
answer
1k
views
Jackson XmlMapper XML Serialization of Java Map With Wrapper Entry Element
The question is about Jackson XML Map serializing and deserializing. By default Jackson expects keys of the map to be XML elements themselves.
<MyMap>
<key1>value1</key1>
<...
1
vote
2
answers
60
views
Order of data read from XML
I have to read data from an XML file and the order is important
I have the following (simplified) XML data which I need to read:
<xmltest>
<type1>
<tekst>ABC</tekst>...
0
votes
1
answer
628
views
Spring Boot Jackson XML Deserialization Ignore Property
During XML deserialization I want to ignore property @XmlSchemaType without modifying annotated class.
DO We have any such ignore control through application.property in spring boot?
-1
votes
1
answer
144
views
Cannot able to deserialize HttpResponseMessage from XML to an Object in c#
I am getting the following xml response from the API endpoint:
<AssumeRoleResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
<AssumeRoleResult>
<...
0
votes
1
answer
426
views
Problem when I add Namespace to the XmlRoot attribute when deserializing an XML
I am deserializing an XML file to a class. I am having trouble with the namespace(s).
When I use the attribute [XmlRoot(ElementName = "LandXML")] it deserializes ok however when I then ...
0
votes
1
answer
133
views
I am unable to deserialize the following XML file
I am trying to deserialize an XML file. The relevant part of the XML is below.
The XML File:
<?xml version="1.0" encoding="utf-8"?>
<LandXML xmlns="http://www....
0
votes
1
answer
58
views
XML Array without container to Object in VB
I have some results sent by a third party that I must load in my system, this is the XML format that I receive and I must first deserialize it to a class and then store it in a database.
XML format:
&...
0
votes
2
answers
390
views
Convert from XML response to list
XElement Xml = null;
var apiResponse = response.Content.ReadAsStringAsync().Result;
Xml = Newtonsoft.Json.JsonConvert.DeserializeObject<XElement>(apiResponse);
XML response from the above code:
...
0
votes
1
answer
827
views
Symfony Serializer - Deserialize XML with attributes
I cant figure out how to deserialize this xml with the symfony serializer
<?xml version="1.0" encoding="UTF-8"?>
<issues>
<issue id="1" name="test&...
0
votes
0
answers
57
views
Failure on deserializing XML elements
Quite straights forward issue, but still can't figure out...
I'm trying to deserialize XML which contains collection of XmlElements. I would like to deserialize the elements (First and second).
The ...
0
votes
1
answer
214
views
XML-based string is failing to post due to DOCTYPE line
I created a C# class based on the test file using paste special -> XML to class. That worked fine, structurally all seems good. However, I am running into an issue where if I paste this into ...
0
votes
0
answers
50
views
XML response deserialization problem - WebService
Good morning,
I'm having trouble getting a response using webservice. It seems that the request is fine because on the server side they receive messages.
ServiceReference1.ServiceClient servClient = ...
0
votes
0
answers
38
views
XML Deserilization - where attribute acts a property of the class
I have an XML in below format
<data><element id='abc.pqr'>1</element><element id='abc.xyz'>2</element></data>
I want to deserilize it in a class below:
class data
{
...
0
votes
1
answer
2k
views
Deserialize XML into a object
Hey everybody i can't deserialize this xml ,having this XML.
string xmlString = "<products>
<product><Id>1</Id><Name>My XML product</Name></Product>
<...
0
votes
0
answers
172
views
Multiple XmlElements referencing to the same property in c#
I have following two files and Because both files having the same structure, I would like to keep one class and refer it multiple times.
XML File1:
<?xml version="1.0" encoding="utf-...
0
votes
1
answer
146
views
Is there a way to deserialize an XML file even if there are missing nodes or more nodes than there should be? C#
I'm working with a lot of XML files that are similar but sometimes each one has more or less nodes. (Let's say that is a billing from a purchase or something like that). But i need to deserialize the ...
0
votes
0
answers
219
views
How can I use generic type parameters with XmlSerializer?
With generic-types, it's possible to give a dynamic type, but is it possible to also give a dynamic value ?
For example, I receive an XML response from a Rest API and I want to Deserialize it into an ...
0
votes
1
answer
624
views
How to deserialize a string representation of boolean in XML
I'm trying to parse xml response containing boolean representation as strings into bool type in a custom structure. A similar question was mentioned here for json files. And I get a runtime error ...
0
votes
2
answers
152
views
Deserialize XML with duplicate nested tags
I'm deserialization the results of a request that has the same tag repeated at multiple levels, I have it working but to do so I'm changing the format of the XML before attempting to deserialize it.
I'...
1
vote
1
answer
82
views
Serialize complex xml file c#
I would like to serialize the following xml file:
<?xml version="1.0" encoding="utf-8"?>
<CrossReference>
<Object Name="Sensor01;">
<Location Name=&...
1
vote
0
answers
58
views
Deserializing XML to class, some elements not not pulling through
I am having some difficulties figuring out how to correctly structure my classes to mirror the XML that I am attempting to deserialize. Most elements are coming through, but for example, in the XML ...
1
vote
1
answer
357
views
Deserialize XML by converting it to json string
I want to deserialize the following XML document:
<?xml version="1.0" encoding="UTF-8"?>
<Jobs>
<Job>
<Id>1</id>
<Description>d1&...
0
votes
1
answer
477
views
C# how to deserialize a single nested class from xml
My C# class:
[XmlRoot("ResultDetails")]
public class MyClass
{
[XmlElement("Id")]
public string Id { get; set; }
[XmlElement("Name")]
public string Name ...