This tag refers to serialization technologies which use XML as a data format.
0
votes
1answer
38 views
serialize a non-serializable object of type Type?
I have an object of type Type
Type typ = CreateDynamicType();
and the creating object of that Type
object instance = Activator.CreateInstance(typ);
This instance is creating fine .Still no ...
0
votes
0answers
17 views
How to control xml-serialization style of empty collections in C#
How can I control xml-serialization style of empty collections in C#?
For example, I need an empty collection to be serialized into pair of open-closing tags:
<SomeEmptyCollection>
...
1
vote
0answers
23 views
Prevent serialization of null members in DataContractSerializer
Let me preface by saying I'm fairly new to WCF, and might be using the wrong terminology throughout here. My project has two components:
A DLL containing the classes for Attachment, Extension, ...
0
votes
1answer
18 views
XmlSerialization with a singleton
Serialization woes continue...
I'm trying to serialize a class, instances of which share between them common objects (a binder of sorts). So, objects A, B, C share object Binder1, and objects D and ...
0
votes
3answers
41 views
XmlSerializer with dependencies results in Null reference exception
I'm running into an issue with Xml serialization of my own class. It is a derived class, which doesn't naturally have a parameterless constructor - I had to add one just for the sake of serialization. ...
1
vote
2answers
45 views
(De)serializing different root element names using one class
I have several XML files with different root elements, but same type of child elements and I would like to be able to create one single class to hold the different root elements and another to hold ...
0
votes
0answers
34 views
XML Serialization to use empty array instead of NULL
I have a property
[XmlElement]
public string[] Emails { get; set; }
which is initialized as string[0] at constructor.
If I XML serialize and deserialize a default instance of this object, the ...
0
votes
0answers
41 views
Generate xml using Dictionary<List<String>,List<string>>
I am having a dictonary like this
private readonly Dictionary<List<String>,List<string>> _optionsetlist=new Dictionary<List<string>, List<string>>();
adding ...
0
votes
1answer
29 views
Serialize to XML and ignore objects with no value set
I am retrieving and deserializing XML, updating a single object value, then (re) serializing to XML.
The retrieved XML only includes fields that have a value (i.e. the application that creates this ...
0
votes
0answers
17 views
Remove namespace from DataContract doesn't work
I have to two simple serialize/desirialize methods,
Mapping:
[System.Runtime.Serialization.DataContract(Namespace = "", Name = "PARAMS")]
public sealed class CourseListRequest {
...
-1
votes
0answers
30 views
is C# XML Serialization Robust? [on hold]
I am looking to use XML Files as my application's Run Time database/variable register. This means that any running variable will be consistently updated into XML files.
I find XML being a lot easier ...
0
votes
1answer
45 views
XML Serializer Does Not Output All Child Elements
I have an excel file. I am taking the first two columns of the file and using the values of those cells to fill the the first two string members of a class. The rest of the string members of this ...
0
votes
1answer
37 views
Can I map two XmlElement to the same string?
I have an xml string I dynamically create from a spreadsheet. There are two columns that are frequently mislabeled by users (yes we have a template that the use most of the time).
I serialize that ...
0
votes
0answers
32 views
Way to Improve XML Writing in VB.Net
Good Afternoon,
I was wondering if anyone had any ideas to shorten my process for writing a XML. At the moment I'm at a Alpha stage with this so its really a mock up. But I've realised i'm only 1/4 ...
2
votes
1answer
25 views
Jaxb. Customize field naming behavior(camelCase to underscore_case)
I want to serialize my fields with underscored names. For example: userName -> user_name.
I know that it can be done with the @XmlElement(name = "user_name") annotation, but it's not very handy for ...
1
vote
1answer
23 views
HttpMediaTypeNotAcceptableException when specifying applicaiton/xml in Accept header
Apologies, I didn't see a tag for java-noob.
I working with an existing restful api in Spring. I was tasked with adding a new api with a couple utility methods, each of which return a string. So far ...
1
vote
1answer
36 views
Custom converter of Simple XML is not serializing from xml to java object
I have a Simple XML annotated class that I want to use for serialization/deserialization. I have a byte[] array which I am using with a custom converter but it fails at the read method..
Here is my ...
0
votes
0answers
7 views
Is it possible to have XStream skip a null element in an array?
If I have an Object[] with the size of, let say, 8, and the 4th element is null, is it possible to call toXML() and have it not return an XML with the 4th element which is null?
0
votes
1answer
14 views
How can I force the default XML namespace to be listed first?
I am working with an xml specification from outside my organization. I need to generate an xml file that complies with the spec. The file will not validate properly unless the default namespace ...
1
vote
1answer
22 views
How to update an XML document by stream reading a file and simultaneously stream writing output
I have to update a node of an existing XML document, challenge is that node value can be too large (~1MB). Is there a way that node value (its stored in a separate file) can be stream read and ...
0
votes
1answer
20 views
How To get xml node from object of type T?
I am trying to convert the object of type T into xml node because I want to display the xml node in a wpf control. Below is the linqpad snippet, I am working with:
[Serializable]
public class test {
...
2
votes
1answer
27 views
Error when deserializing enum on c# datacontract
I have the following DataContract: Note: I don't have permission on changing the DataContract. I'm only referencing on it.
[Serializable]
[DataContract]
public class Client
{
public ...
1
vote
2answers
40 views
Should booleans in an XML file format be written as true/false or 1/0?
After thirty years of developing binary file formats I'm (finally) writing out an XML document file format.
I've arrived at a part of my document header where I need to write around fifty separate ...
1
vote
2answers
45 views
Can't Serialize Custom Types
I'm trying to extend the UserArea in the hr-xml type ProcessOrganizationChartDataAreaType
I defined type OrganizationChartUserArea that inherits from UserAreaType1
[XmlType]
public class ...
1
vote
0answers
13 views
Deserializing UITest using XMLSearializer, few Action collections are blank, while Maps are fine
I am trying to programatically edit the uitest file generated by Visual Studio 2012.
I am deserializing a uitest file (which I am guessing just serialized XML for UITest class) using a standard ...
-1
votes
1answer
26 views
c# how to write in xml serialization instead of json
I know json very well but not sure how to do with xml serialization. i would be glad if you dont mind to change json codes for xml serialization. thanks so much!
how to replace this with xml ...
0
votes
3answers
73 views
how to serialize class objects to xml document
I hope to find a solution from you. What I need is to serialize ValidatorList class object into an xml document. How to do this?
I tried like this:
XmlSerializer _serializer = new ...
1
vote
2answers
28 views
Ignore outer elements using XmlSerializer
I am trying to deserialize the XML document:
<?xml version='1.0' encoding='UTF-8'?>
<eveapi version="2">
<currentTime>2013-07-07 07:24:20</currentTime>
<result>
...
0
votes
0answers
8 views
Custom Converter not working when JavaBeanConverter set with high priority
I have registered JavaBeanConverter for my POJO with high priority so that it has higher priority than ReflectionConverter. It works perfectly fine for all the fields.
Now I want to add a ...
0
votes
1answer
20 views
How to use ISeriealizeable attribute to serialize only relevant fields?
I have a class called MyBoard that looks like this
Public MyBoard
{
private BoardTile[,] tiles;
private bool tilesEliminated;
public int blabla {get; set; }
}
If i understand correctly the ...
0
votes
0answers
28 views
Web API and XML
I am doing my first experiments with the Web API and I am finding particularly cumbersome to work with XML. Apparently, anything can be serialized in nice JSON, but weird things happen when you try to ...
-1
votes
0answers
21 views
Serialize image and metadata in XML
For example I have a class
[Serializable()]
public class image_data
{
public Bitmap img;
public Rectangle rc;
}
and I need to add(append) one object of this class to my xml file and then I need ...
0
votes
0answers
16 views
Serializing List of base object types using XmlMessageFormatter
I have an object like so:
public class Intent
{
public List<Entity> Updates { get; set; }
}
Which I wish to serialize into XML for passing as a message using MSMQ. The list of type Entity ...
0
votes
2answers
48 views
Deserialise XML into a IDictionary
I am creating an app that fetches fuel prices from a web service. I want to deserialise the prices a IDictionary of Price objects with the fuel as the key (similar to this).
I had created a setter ...
2
votes
1answer
45 views
SimpleFramwork XML: Element with Inner Text and Child Elements
I have the following situtation in deserializing xml using SimpleFramework of specific format that cannot be changed...
<Question ID="Q1">
THIS INNER TEXT IS THE ISSUE
<Criteria ...
1
vote
1answer
40 views
Serialize class to XML results in “invalid XML document” error
I have an object of the following class:
public class Root
{
[XmlElement]
public BOMItems[] Row { get; set; }
}
public class BOMItems
{
[XmlElement("ITEMNO")]
public string ITEMNO { ...
2
votes
2answers
45 views
Deserialize XML string not working
I have this XML string
<Root>
<Row>
<ITEMNO>1</ITEMNO>
<PARTSOURCE>Buy</PARTSOURCE>
<QTY>2</QTY>
...
0
votes
0answers
35 views
Prefix SOAP XML Instead direct namespace
I am working with one of our partner to integrate our business services. I am using WCF (.Net 3.5) to communicate with partner web service. I think partner web service is written in Java.
Using SVC ...
1
vote
2answers
32 views
Xml Reading with backward Compatibility
The XML that i am currently working is directly formed using XML serializer (Serializing Class and its nested counter parts)
Also if there is an addition of a new Property is directly handled by the ...
2
votes
1answer
40 views
Serialization of graphic objects
I have a complex shape. Application allows to draw any count of this shapes.
Then I must save that picture as XML file. How can I save them on XML file?
My .xml is created but there is only ...
1
vote
2answers
37 views
How to Serialize List<CustomClass> into XML
I have serialize List<Server> servers.
Server class has this variables:
public class Server
{
string serverName { get; set; }
string dnsIP { get; set; }
Game game { get; set; }
...
2
votes
1answer
95 views
Serializing a class containing List<Object>
I am new to this site so I apologize for any improper formatting on my part.
I'm working on a project and am trying to Serialize a class that contains a List of type TDF_Test into an XML file but I ...
0
votes
0answers
27 views
XML Namespaces in MVC4 Web API
I am currently working on a project that requires me to output XML from its endpoints along with JSON. I have the following model:
[DataContract(Namespace="http://www.yale.edu/tp/cas")]
...
0
votes
1answer
16 views
XSD.exe (.Net 2.0) download?
I need an older version of XSD.exe (comes with VS 2005), preferably a version compatible with .Net 2.0, to generate classes.
Could somebody provide an existing (official) link or possibly upload a ...
0
votes
1answer
54 views
Building HL7 CCD (based on CDA) for cancer registries (Meaningful Use Lvl 2)
I have two issues regarding the generation of CCD messages for cancer registries. I already have a CCD class, generated from a CCD XML schema (XSD).
First, this is an older schema. It seems to be ...
0
votes
1answer
18 views
What is the purpose of XML attributes on classes that will be serialized to XML?
In researching the serialization of .NET objects -- be they native or custom classes -- I've noticed that people put XML-specific attributes on the class and its members. However, when I seriliaze a ...
1
vote
1answer
23 views
XML parsing using attributes
I have XML-based config for application shortcuts bindings. i need to parse it.
<ShortcutBinding>
<ShortcutHandler Name ...
2
votes
3answers
106 views
Encoding binary data within XML : alternatives to base64
I want to encode and decode binary data within an XML file (with Python, but whatever). I have to face the fact that an XML tag content has illegal characters. The only allowed ones are described in ...
0
votes
1answer
55 views
Deserializing string list with “\n” results in empty string
I have been banging my head on this one for a bit. It seems like it must be a simple solution but I have searched the internet and tried quite a few things.
I have a complex object which includes a ...
0
votes
1answer
30 views
Serialize member types without using XmlInclude in .NET
I am carrying out XML Serialization in .NET
I have the following class
public class MainClass
{
public ClassA A;
}
public class ClassA { }
public class ClassB : ClassA { }
public class ClassC ...