<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Introduction to XML Serialization</title>
	<atom:link href="http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/</link>
	<description>Software by Design</description>
	<pubDate>Fri, 04 Jul 2008 03:18:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: C# Serializing Nullable Types by JohnnyCoder</title>
		<link>http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-2101</link>
		<dc:creator>C# Serializing Nullable Types by JohnnyCoder</dc:creator>
		<pubDate>Mon, 09 Jun 2008 19:56:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-2101</guid>
		<description>[...] Introduction to XML Serialization [...]</description>
		<content:encoded><![CDATA[<p>[...] Introduction to XML Serialization [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghu</title>
		<link>http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-2096</link>
		<dc:creator>Raghu</dc:creator>
		<pubDate>Thu, 05 Jun 2008 01:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-2096</guid>
		<description>Hi, I have a similar requirement to serialize a Business object into XML and I thought of using the XmlSerializer as well. But after a bit of experimentation i realized that there is no way to serialize properties that are read-only and the only workaround i could find was to have an empty set accessor for these props. Another particular type that i had problem with was TimeSpan. The XmlSerializer had no idea of how to serialize a TimeSpan type. So that means all my classes that have a Timespan prop have to inherit from IXmlSerializable and they must implement the WriteXml function of this interface. Did anyone else ever had a similar situation ? Please let me know.

Thanks in anticipation.</description>
		<content:encoded><![CDATA[<p>Hi, I have a similar requirement to serialize a Business object into XML and I thought of using the XmlSerializer as well. But after a bit of experimentation i realized that there is no way to serialize properties that are read-only and the only workaround i could find was to have an empty set accessor for these props. Another particular type that i had problem with was TimeSpan. The XmlSerializer had no idea of how to serialize a TimeSpan type. So that means all my classes that have a Timespan prop have to inherit from IXmlSerializable and they must implement the WriteXml function of this interface. Did anyone else ever had a similar situation ? Please let me know.</p>
<p>Thanks in anticipation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mytymyky</title>
		<link>http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-2080</link>
		<dc:creator>Mytymyky</dc:creator>
		<pubDate>Tue, 20 May 2008 20:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-2080</guid>
		<description>I came across this page looking for a solution to the problem i'm having and mentioned by Rob. Seems nullable types won't serialize as attributes, only as elements. I use ALOT of nullable types in my apps (not sure its the best way to go, but oh well) and I was trying to add them ás attributes instead of elements (to eliminate part of the tag's overhead) but I've had no luck.

For now element's is how it will be...</description>
		<content:encoded><![CDATA[<p>I came across this page looking for a solution to the problem i&#8217;m having and mentioned by Rob. Seems nullable types won&#8217;t serialize as attributes, only as elements. I use ALOT of nullable types in my apps (not sure its the best way to go, but oh well) and I was trying to add them ás attributes instead of elements (to eliminate part of the tag&#8217;s overhead) but I&#8217;ve had no luck.</p>
<p>For now element&#8217;s is how it will be&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-1146</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Mon, 13 Aug 2007 16:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-1146</guid>
		<description>Yes, it does handle null properties, but you must mark properties that may be null as such. Properties marked with XmlAttribute are nullable by default. Properties that are Xml elements must be marked like this;

[XmlElement( IsNullable=true )]

This assumes of course that the property is nullable (a reference, not a value type). I haven't figured out yet how to work with .NET 2.0 nullable types like 

int? value;</description>
		<content:encoded><![CDATA[<p>Yes, it does handle null properties, but you must mark properties that may be null as such. Properties marked with XmlAttribute are nullable by default. Properties that are Xml elements must be marked like this;</p>
<p>[XmlElement( IsNullable=true )]</p>
<p>This assumes of course that the property is nullable (a reference, not a value type). I haven&#8217;t figured out yet how to work with .NET 2.0 nullable types like </p>
<p>int? value;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John S.</title>
		<link>http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-1145</link>
		<dc:creator>John S.</dc:creator>
		<pubDate>Mon, 13 Aug 2007 15:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.alteridem.net/2007/08/13/introduction-to-xml-serialization/#comment-1145</guid>
		<description>How does it handle null properties?</description>
		<content:encoded><![CDATA[<p>How does it handle null properties?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
