Provides custom formatting for XML serialization and deserialization.
Questions tagged [ixmlserializable]
115 questions
1
vote
1 answer
Why does XmlSerializer throws an Exception and raise a ValidationEvent when a schema validation error occurs inside IXmlSerializable.ReadXml()
I have written some tests for reading an XML file and validating it against an XSD schema.
My data objects are using a mix of attribute based and custom IXmlSerializable implementation and I am using the XmlSerializer to perform deserialization.
My…

Tim Calladene
- 107
- 12
1
vote
1 answer
how to serialize a property property only not the whole property using xml attributes?
I want to serialize an object that contains properties and one of these properties I want only to serialize its name.
How to do this without implmeneting IXmlSerializable interface, only using attributes.
[Serializable]
public class Class
{
…

Shehab
- 431
- 2
- 10
1
vote
1 answer
How to implement IXmlSerializable.ReadXml in case of using AbstractFactory-Pattern and Polymorphism
I'm using an AbstractFactory and polymorphism in my project and need to de-serialize xml to the correct type depending on a xml-element under the parent.
To be more specific (some pseudo code for explanation):
Public Interface IAnimal
…

Marko Pareigis
- 43
- 5
1
vote
2 answers
How to implement IXmlSerializable for recursive tags in XML
I wonder how to implement the method ReadXml of the IXmlSerializable interface when my XML contains recursive tags like in the following example:
1
vote
0 answers
Using WCF client: "Use the XmlInclude or SoapInclude attribute to specify types that are not known statically."
I have to call a Web Service, that in the request, has a property like this:
[System.Xml.Serialization.XmlElementAttribute("Criteria", typeof(QueryTypeCriteria), Order=2)]
[System.Xml.Serialization.XmlElementAttribute("Identification",…

felixmondelo
- 1,324
- 1
- 10
- 19
1
vote
0 answers
How to pass array of IXmlSerializable class as parameter to WCF?
I have two classes, one implements IXmlSerializable and one has DataContract attribute:
public class Foo : IXmlSerializable
{
public XmlSchema GetSchema()
{
return null;
}
public void ReadXml(XmlReader reader)
{
…

Michele mpp Marostica
- 2,445
- 4
- 29
- 45
1
vote
1 answer
VB.NET Serealize structure that contains lists
I'm searching a way to serialize a structure that contains different kind of object such as Strings, Integer and Collections.
I have this data structure:
Dim database as New mainStruct
Structure mainStruct
Public name As…

Dandux97
- 13
- 2
1
vote
1 answer
Deserializing collection of types implementing IXmlSerializable runs forever
I have a class implementing IXmlSerializable. This class contains a few properties. Serializing and Deserializing a single instance of the class works fine. But in case of collection of the class, Serialization works fine but Deserialization runs…

Kannan D
- 467
- 1
- 4
- 15
1
vote
1 answer
WCF service xsd after IXmlSerializable implementation is not correct
I have a wcf service (using xmlserialization).
There is some class which looks in SoapUI like this:
?
?
I had to implement IXmlSerializable interface on…

crocodayl
- 99
- 9
1
vote
1 answer
IXMLSerializeable
I need to implement IXMLSerializeable for custom serialization on 2 members, but I want the rest of the members to be serialized with the default serialization. Or at least, is there a way for me to invoke the standard serialization on the other…

Fragilerus
- 1,829
- 3
- 15
- 22
1
vote
2 answers
Dictionary serialization: after ReadXml(), subsequent XML elements are skipped
In one of my objects I have a dictionary that is serialized by implementing IXmlSerializable:
public SerializableStringDictionary Parameters { get; set; }
When I serialize a list of these object with the normal .NET serializer it serializes…

Martin
- 397
- 3
- 16
1
vote
1 answer
Serialize a type with XmlSerializer by omitting it when it has a null field
Here's a self-contained sample program that demonstrates my question: https://gist.github.com/jennings/46c20733df559d02b9ad
I'm writing a type Maybe which looks like this:
public struct Maybe : IXmlSerializable where T : class
{
readonly T…

Stephen Jennings
- 12,494
- 5
- 47
- 66
1
vote
1 answer
Xml serialization with custom schema and IXmlSerializable
I'm trying to serialize an object using IXmlSerializable and the XmlSchemaProviderAttribute.
The schema looks like this:

Streamline
- 952
- 1
- 15
- 23
1
vote
1 answer
representing an XML config file with an IXmlSerializable class
I'm writing in C# and trying to represent an XML config file through an IXmlSerializable class. I'm unsure how to represent the nested elements in my config file, though, such as logLevel:
…

Sarah Vessels
- 30,930
- 33
- 155
- 222
1
vote
1 answer
Different return XML in a WCF Operation
I am writing a service to a international HTTP standard, and there is one method that can return three different XML results, call them Single, Multiple and Error. Now I've written an IXmlSerializable class that can consume each of these results and…

Sean Hederman
- 460
- 3
- 13