xml-serialization

What to do with XML Files generated by my Application

I am making an application that persists several different user settings. The way I have done it is just to serialize my collections (with the settings in them) to XML files. As they are changed I update the saved file so that when the user runs again, the settings are saved. As I get going with this style of persistence, I am finding...

Change the XML Serializer's element name of an array element

I have a class which is generated from an XML file via the XSD.exe tool. The class I have contains an array with elements. Until recently, rendering the whole document from a fully instantiated business object was possible, however due to the size, we now need to render the documents array elements to a stream so that we don't run out ...

Construct complex xml from models and custom data, using declarative approach

Hi, i need to render a complex xml, that may looks like this: <container attr1="" attr2=""> <user login="" /> <product name="" version="" /> <anotherTag /> </container> user and product are the model-objects. container's attributes has values, not related to models, anotherTag has some another information, also not related...

Serialize List<> of classes declared with internal modifier?

I'm trying to add XML serialization to a fairly trivial class structure in C#. Essentially, there's a single instance of a root class (call it AClass), which holds a List of several instances of some other class (call it AnotherClass): [XmlRoot("RootNode")] public class AClass { [XmlElement("ListNode")] internal List otherObject...

Need to convert an object to XML and getting an error

I have this class: <Serializable()> _ Public Class Bonder ''' <summary> ''' General information ''' </summary> ''' <remarks></remarks> Public BonderName As String Public Serial_Number As String Public System_Type As String Public DM_Version As String Public RTS_Build As String Public RTS_Lab...

How to Xml serialize a LinkedList?

.NET 2 Actually there are methods to XML serialize a List<T>. What if I have an object that has a public LinkedList<T> member? Without creating a public duplicate as List<T> from LinkedList<T>. Maybe a way to control the Xml serialization like binary (OnSerializing, OnDeserializing). Will be impossible to XML serialize a object with ...

c# inheriting generic collection and serialization…

Hi Guys with reference to c# inheriting generic collection and serialization… question If you are providing a paged collection it is useful to pass back the total available so the client can set up they paging control. Does anyone know a nice way to achieve? Also why is this "By Design" seems pointless. Cheers. ...

How to change the extension of a processed xml file (using eXist & cocoon)

Hi all, I'm really new to this whole web stuff, so please be nice if I missed something important to post. Short: Is there a possibility to change the name of a processed file (eXist-DB) after serialization? Here my case, the following request to my eXist-db: http://localhost:8080/exist/cocoon/db/caos/test.xml and I want after seria...

Removing XML Namespaces from XML Serialized Output

I am generating this XML using the serializer in VB.net as shown below Dim string_writer As New StringWriter() Dim serializer As New XmlSerializer(GetType(MyClass)) serializer.Serialize(string_writer, addr) txttest.Text = string_writer.ToString() though it is returning XML, I see xmlns="http://tempuri.org/ in all the elements, is ther...

How does the XML class look ?

I need to know how the XML class for the serialization should look like: I need this XML <?xml version="1.0" encoding="UTF-8"?> <import date="2010-02-12T23:33:39"> <T_Employee> <MI_KZ>HKBZV</MI_KZ> <MI_Name>John</MI_Name> <MI_Vorname>Doe</MI_Vorname> <MI_Nummer>987654321</MI_Nummer> <MI_DatumVon>2010-02-11T10:45:3...

Deseralizing XML into simple .NET class, cannot populate property from root node attribute.

I have a simple class that I trying to populate from an XML document. The XML file has an attribute called TrackingID in the root node which I would like to get as a property. For some reason, when I deseralize the class, the TrackingID is null. Everything else populates fine. I have tried various attributes on the TrackingID property ...

Applying SoapIgnore attribute doesn't take any effect to serialization result

I'm trying to figure out .NET serialization stuff and experiencing a problem. I've made a simple program to test it and got stuck with using attributes. Here's the code: [Serializable] public class SampleClass { [SoapIgnore] public Guid InstanceId { get; set; } } class Program { static void Main() ...

XElement Add function adds xmlns="" to the XElement

I have a function which generates xml for a list object: public XDocument ToXML() { foreach (var row in this) { var xml = row.ToXml(); template.Root.Add(xml); } return template; } The template.ToString() reads: <RootElement xmlns="urn:testTools"> The xml reads: <Example><SubElement>testData</SubElement...

Deserialize XML without namespaces but in a class expecting namespaces

Duplicate: Omitting all xml namespaces when serializing an object? Not the same.. I want in the other way: Deserialize! I have a C# class as bellow: [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentMode...

.NET Custom Xml Serialization

I am working on some classes which I need to serialize/deserialize to xml, that can be used for configuration. Here is a sample of what I am trying to do [Serializable] public class MyConfig { [XmlElement] public string ConfigOption { get; set; } [XmlElement] public Uri SomeUri { get; set; } } I want to override the ...

modifying to an xml file cocoa

Hi, In Cocoa, how can i modify an xml file and save the same for future use. ...

How do you use XMLSerialize for Enum typed properties in c#?

I have simple enum, enum simple { one, two, three }, and I have a class that has a property of type simple. I tried decorating it with the attribute: [XmlAttribute(DataType = "int")], but when I try to serialize it using an XmlWriter, it fails. WHat is the proper way to do this? Do I have to mark the enum itself as well as the property, ...

Performance hit when using XmlReaderSettings.Schemas and specifying multiple schemas to be used

I am using XmlReader to validate a XML file as per the supplied schema. For that I am creating an instance of XmlReaderSettings and setting it's ValidationType as ValidationType.Schema and it's Schemas Property as XxmlSchemaSet. A draft code is like XmlReaderSettings rSettings = new XmlReaderSettings(); XmlSchemaSet schemaSet = new Xml...

Could not find file "C:\WINDOWS\TEMP\xxxx.dll

Hi All, I know this question has been asked many times and I have done some extensive research on the internet to try and resolve the issue but everything I have tried has failed and I really need to sort this issue out, hence my post. Here is what I have tried: Change the directory in which the temp files are stored. (Changed locally...

Serializing java objects with respect to xml schema loaded at runtime

I call an XML document three-layered if its structure is laid out as following: the root element contains some container elements (I'll call them entities), each of them has some simpleType elements inside (I'll call them properties). Something like that: <data> <spaceship> <number>1024</number> <name>KTHX</name> </spaceship> ...