xml-serialization

SGEN XMLSerializer - should be .XMLSerializers.dll added as a reference to the current project or to the GAC?

Hi, I do some stuff with XMLSerializer class. Like a most of beginners I face with performance issue on app start. I read a lot of blogs, articles and finally use SGEN tool. Now performance looks to be ok but few things are still not clear for me. 1) Should I use SGEN syntax like this: SGen.exe /assembly:MyAssembly /type:MyRootXmlType...

working python xml

hello all, my question is the following, which is the best way of working XML (kml) with python?, especially script serializable. thanks for your attention and answers ...

XmlSerializer and Mark-up (Xml or Html)

Hi, I've a requirement to serialize any class provided (decorated with the appropriate XmlElement/ XmlAttribute etc), but some of the properties may contain some sort of mark-up...usually HTML, but it could as easily be XML in the future. When trying to serialize the class the XmlSerializer crashes. I'd hope to be able to apply no mor...

Delphi 2010 DeHL Serialization XML and custom attribute : how it work ?

Hi all, I try to investigate DeHL with Delphi 2010 custom attribute and I get problem. TAppParamTest = class public User: string; Password: string; end; TAppParam = class private FTest: TAppParamTest; public constructor Create; destructor Destroy; override; property Test: TAppParamTest read FTest w...

How to set xmlns when serializing object in c#

I am serializing an object in my ASP.net MVC program to an xml string like this; StringWriter sw = new StringWriter(); XmlSerializer s = new XmlSerializer(typeof(mytype)); s.Serialize(sw, myData); Now this give me this as the first 2 lines; <?xml version="1.0" encoding="utf-16"?> <GetCustomerName xmlns:xsi="http://www.w3.org/2001/XML...

Correct XML serialization and deserialization of "mixed" types in .NET

My current task involves writing a class library for processing HL7 CDA files. These HL7 CDA files are XML files with a defined XML schema, so I used xsd.exe to generate .NET classes for XML serialization and deserialization. The XML Schema contains various types which contain the mixed="true" attribute, specifying that an XML node of t...

.NET asmx web services: serialize object property as string property to support versioning

I am in the process of upgrading our web services to support versioning. We will be publishing our versioned web services like so: http://localhost/project/services/1.0/service.asmx http://localhost/project/services/1.1/service.asmx One requirement of this versioning is that I am not allowed to break the original wsdl (the 1.0 wsdl). ...

Deserialize generic collections - coming up empty

I've got a settings object for my app that has two collections in it. The collections are simple List generics that contain a collection of property bags. When I serialize it, everything is saved with no problem: XmlSerializer x = new XmlSerializer(settings.GetType()); TextWriter tw = new StreamWriter(@"c:\temp\settings.cpt"); x.Seriali...

XML serializer filename

I want to serialize an object into an xml and I want the filename of the xml to be random as following 636211ad-ef28-47b9-aa60-207d3fbb9580.xml fc3b491e5-59ac-4f6a-81e5-27e971b903ed.xml I am just curious on how to do such thing? ...

Can the XML serializer output empty tags?

I am using the XML serializer. I would like it to convert all my object's elements, but it only seems to output tags when there is a value. How can I get it to output empty tags? ...

How to serialize objects into Spring xml files ?

I am wondering if it is possible to save objects into Spring language... In Java it seamed possible (search for spring java marshaling). But Google did not help me finding what I am looking for concerning Spring.Net. So, I am asking if you guys know one tool that includes this feature. ...

.NET XmlSerializer fails with List<T>

I'm using a singleton class to save all my settings info. It's first utilized by calling Settings.ValidateSettings(@"C:\MyApp"). The problem I'm having is that 'List Contacts' is causing the xmlserializer to fail to write the settings file, or to load said settings. If I comment out the List<T> then I have no problems saving/loading the...

Serialize a C# class to xml. Store the XML as a string in SQL Server and then restore the class later

I want to serialize a class to xml and store that in a field in a database. I can serialize with this: StringWriter sw = new StringWriter(); XmlSerializer xmlser = new XmlSerializer(typeof(MyClass)); xmlser.Serialize(sw, myClassVariable); string s = sw.ToString(); sw.Close(); Thats works, but it has the namespaces in it. <.... xmln...

Is reading xml simple in rails or converting it to hash will be simpler?

Hi All, Sorry for this question but after spending 1-2 hours on how to read xml, i thought posting it on forum will be better. So i get a complex (very large)xml response from the plugin trackify. i want to read some values from it so i convert it into hash and then read it as follows For ex:- to read city @tracking_info['TrackResponse...

Create an Xml file from an object

I work as a web developer with a web designer and we usually do like this : - I create the system , I generate some Xml files - the designer display the xml files with xslt Nothing new. My problem is that I use Xml Serialization to create my xml files, but I never use Deserialization. So I'd like to know if there is a way to avoid fix ...

Exporting to XML, including embedded classes

I have an object config which has some properties. I can export this ok, however, it also has an ArrayList which relates to embedded classes which I can't get to appear when I export to XML. Any pointers would be helpful. Export Method public String exportXML(config conf, String path) { String success = ""; try { FileOu...

Model binding HttpPostedFileBase and then storing the file to datastore

ASP.NET MVC seems to correctly automatically bind between HTML form's file input field and HttpPostedFileBase. On the other hand it cannot bind from file input field to byte array..I tried and it issues exception - something about not being able to convert to Base64. I had only the byte array property on my Model classes previously becau...

XmlSerializer.Serialize doesn't save a file and doesn't throw an exception.

Hi guys. I am having problem with saving of my object. Take a look at this code: public void SerializeToXML(String FileName) { XmlSerializer fSerializer = new XmlSerializer(typeof(Configuration)); using (Stream fStream = new FileStream(FileName, FileMode.Create, FileAccess.Write, FileShare.None)) { fSerializer.Seria...

Recursive XSD Help

Hi, i'm trying to learn a little bit XSD and I'm trying to create a XSD for this xml: <Document> <TextBox Name="Username" /> <TextBox Name="Password" /> </Document> ... so there's an element, which is an abstract complex type. Every element have elements and so on. Document and TextBox are extending Element. I trid this: <?xml v...

Any XmlSerialization Limitations in WCF (as opposed to DataContract)?

Is there anything I might regret later, i.e. any major limitations if we choose XmlSerialization instead of DataContract? Until now, we have embraced the schema first contract design. For example, if we want to parameter inspection, security enhancements, etc... will locking in now with XmlSerialization be a problem when we try to add...