<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Xmlguy Weblog</title>
	<atom:link href="http://xmlguy.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://xmlguy.wordpress.com</link>
	<description>a place where talk about developing, job experience and technology related topics, devoted to xml</description>
	<lastBuildDate>Wed, 06 May 2009 11:09:34 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='xmlguy.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/6bec7dd46e67decc4510a93b09366a16?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Xmlguy Weblog</title>
		<link>http://xmlguy.wordpress.com</link>
	</image>
			<item>
		<title>Points of view</title>
		<link>http://xmlguy.wordpress.com/2009/05/06/points-of-view/</link>
		<comments>http://xmlguy.wordpress.com/2009/05/06/points-of-view/#comments</comments>
		<pubDate>Wed, 06 May 2009 11:09:34 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Senza Categoria]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2009/05/06/points-of-view/</guid>
		<description><![CDATA[&#160;
In these days I’m thinkng about the concept of “Achitecture” and “Architect”. Even now I’m experimenting what I’ve experienced for years about what the folks (in my country) thinks about that, and I’m, or better, I can be too confused..
I don’t want to fall here in discussions about what is an architect or what is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=104&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&#160;</p>
<p align="justify">In these days I’m thinkng about the concept of “Achitecture” and “Architect”. Even now I’m experimenting what I’ve experienced for years about what the folks (in my country) thinks about that, and I’m, or better, I can be too confused..</p>
<p align="justify">I don’t want to fall here in discussions about <strong>what is an architect</strong> or <strong>what is and what makes an architecture</strong> because I thinks many good peolple talked about that (i.e. <a href="http://www.rgoarchitects.com/" target="_blank">Arnon Rotem</a>), I want just to post some thoughts about the fact generally people, in this job, think about architecture, design, development, as maybe the easiest thing to… I’m saying that because every day when decisions needs to be taken, or things have to be done well, the words I usually listen are “It must works”, “It must be done early and dirty” and so on… you can imagine what is the flow…</p>
<p align="justify">What I think, and everytime I stay on that, software architectures, software architect, doing this job in general, is not a trivial job as It can seems to the folks (I say this with caution..) It’s not possible to think our job could be done by everybody, not because to be architects or related is to be an <strong>elite</strong>, but because IT’S NOT SO SIMPLE AS IT COULD SEEMS in general.</p>
<p align="justify">I’m not helped by my poor english to explain my concept, but I hope I can try.. I fell in so many troubles about bad decisions, bad organizations, bad communications, and so on in my tiny past (11yr) even me I did in bad things, but I hope I’ve learned from my mistakes.. but this story is going on and sometimes I think it never stops..</p>
<p align="justify">Recently I’m thinking about the fact, technologies, framework, tools, languages and so on, became everytime more detailed, <strong>more</strong> in general, and the learning curve is eccesive than before, I think about the VB3/4/5/6, COM times, sometimes I thinks this could helps to understand the fact <strong>we have to continuosly learn</strong>, <strong>concepts became everytime more sofisticated</strong>, <strong>we have to be professionals </strong>and good programming can’t be made by tools, Drag and dropping things or something similar. We daily read good people and good techinicians blogs, read articles and more, but our daily life it’s more soiled than the “dreaming” reality people continuosly read about… I call it “dreaming” because I would like if it could be reality, but in real, things are so dirty, and we have to <strong>fight</strong> to try to do things well, and why not with passion…</p>
<p align="justify">I can continue talking about that hours, but now I stop, I’d like to know you’re opinion, how are things in your reality, in your country, or better near to you? I’m living in Italy..</p>
<p>&#160;</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:be67e8a6-fcad-49b1-a0c7-6e2f74fc0f9f" class="wlWriterEditableSmartContent">Technorati Tag: <a href="http://technorati.com/tags/Personal" rel="tag">Personal</a>,<a href="http://technorati.com/tags/Work" rel="tag">Work</a></div>
Posted in Senza Categoria  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=104&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2009/05/06/points-of-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
		<item>
		<title>Blogging tales: What&#8217;s new on the way&#8230;</title>
		<link>http://xmlguy.wordpress.com/2009/03/19/blogging-tales-whats-new-in-the-way/</link>
		<comments>http://xmlguy.wordpress.com/2009/03/19/blogging-tales-whats-new-in-the-way/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 07:53:58 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2009/03/19/blogging-tales-whats-new-in-the-way/</guid>
		<description><![CDATA[Hi, recently I bought a web space to finally host my web site an official blog. I’m experiencing some troubles with subtext so I haven’t do an entire blog export from here to there, I have problems with the image publishing feature, but at now, it’s still alive, some post are there, the layout is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=101&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">Hi, recently I bought a web space to finally host my web site an official blog. I’m experiencing some troubles with <strong>subtext</strong> so I haven’t do an entire blog export from here to there, I have problems with the image publishing feature, but at now, it’s still alive, some post are there, the layout is standard one, I hope I can change it soon…</p>
<p align="justify">The new blog is at <a title="Xml guy weblog" href="http://xml-guy.com/Blog/" target="_blank">http://xml-guy.com/Blog/</a> and soon wille available in the root my new web site..as professionals says “stay tuned!”</p>
<p align="justify">Ciao</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:810a5e2d-94b5-4bb5-bff5-b86a62864a17" style="display:inline;float:none;margin:0;padding:0;">Technorati Tag: <a href="http://technorati.com/tags/Personal" rel="tag">Personal</a>,<a href="http://technorati.com/tags/Tools" rel="tag">Tools</a></div>
Posted in Events, Personal, Tools  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=101&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2009/03/19/blogging-tales-whats-new-in-the-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET MVC Released</title>
		<link>http://xmlguy.wordpress.com/2009/03/19/aspnet-mvc-released/</link>
		<comments>http://xmlguy.wordpress.com/2009/03/19/aspnet-mvc-released/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 07:43:33 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Senza Categoria]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2009/03/19/aspnet-mvc-released/</guid>
		<description><![CDATA[&#160;
Hi this morning I found an email with this notice: “ASP.NET MVC RELEASED”… In the firs time I found it a joke or something else which doesn’t matter, but the email continue with a link to the download page.
Now I’m reading the release notes..very interesting, and as the email says: “I don&#8217;t think there&#8217;s been [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=100&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">&#160;</p>
<p align="justify">Hi this morning I found an email with this notice: “<strong>ASP.NET MVC RELEASED</strong>”… In the firs time I found it a joke or something else which doesn’t matter, but the email continue with a link to the <a title="ASP.NET MVC 1.0 Release" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&amp;displaylang=en" target="_blank">download page</a>.</p>
<p align="justify">Now I’m reading the release notes..very interesting, and as the email says: “I don&#8217;t think there&#8217;s been an official announcement yet, but we all    <br />kind of knew (or highly suspected) it was coming at MIX anyway.”</p>
<p align="justify">Ciao</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:eb5c7a35-b2f2-4d34-b800-54a0683682e2" style="display:inline;float:none;margin:0;padding:0;">Technorati Tag: <a href="http://technorati.com/tags/ASP.NET" rel="tag">ASP.NET</a>,<a href="http://technorati.com/tags/ASP.NET+MVC" rel="tag">ASP.NET MVC</a></div>
Posted in Senza Categoria  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=100&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2009/03/19/aspnet-mvc-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
		<item>
		<title>Developer Events n°1 &#8211; UGIALT.net Conference</title>
		<link>http://xmlguy.wordpress.com/2008/12/09/developer-events-n1-ugialtnet-conference/</link>
		<comments>http://xmlguy.wordpress.com/2008/12/09/developer-events-n1-ugialtnet-conference/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 17:55:22 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2008/12/09/developer-events-n1-ugialtnet-conference/</guid>
		<description><![CDATA[&#160;
 
Hi, I will share and give my support to the next UGIALT.net event, I hope I could be there, but however you find in my Events page details about events I support or I will partecipate to.
This kind of event is one the best suitable for developers who shares the &#8220;ALT philosophy&#8221;, I invite [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=93&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">&nbsp;</p>
<p align="justify"><a href="http://www.ugialt.net"><img alt="UGI Alt.net conf" src="http://www.ugialt.net/GetFile.aspx?File=conf3med.jpg" border="0"></a> </p>
<p align="justify">Hi, I will share and give my support to the next <a href="http://ugialt.net/" target="_blank">UGIALT.net</a> event, I hope I could be there, but however you find in my <a href="http://xmlguy.wordpress.com/events/" target="_blank">Events</a> page details about events I support or I will partecipate to.</p>
<p align="justify">This kind of event is one the best suitable for developers who shares the &#8220;ALT philosophy&#8221;, I invite you to go the the site (go to link above) and to see the detailed agenda. unfortunately the link, the material and the event all is in Italian..</p>
<p align="justify">Ciao!</p>
<p>Tags: <a href="http://technorati.com/tag/ALT, Events" rel="tag">ALT, Events</a></p>
Posted in Events Tagged: Events <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=93&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2008/12/09/developer-events-n1-ugialtnet-conference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>

		<media:content url="http://www.ugialt.net/GetFile.aspx?File=conf3med.jpg" medium="image">
			<media:title type="html">UGI Alt.net conf</media:title>
		</media:content>
	</item>
		<item>
		<title>Developer News &#8211; Outlook HOL WPF Gotcha!</title>
		<link>http://xmlguy.wordpress.com/2008/12/05/developer-news-outlook-hol-wpf-gotcha/</link>
		<comments>http://xmlguy.wordpress.com/2008/12/05/developer-news-outlook-hol-wpf-gotcha/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 17:02:45 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2008/12/05/developer-news-outlook-hol-wpf-gotcha/</guid>
		<description><![CDATA[Recently I&#8217;m doing some study on some WPF code, I fall in an interesting example from Microsoft called Outlook HOL WPF, which basically shows how to do an Outlook UI WPF replica, I found many posts about that but each with the same problem, where is the source code?? The missing..
So, after some Googlin&#8217; I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=82&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">Recently I&#8217;m doing some study on some WPF code, I fall in an interesting example from Microsoft called Outlook HOL WPF, which basically shows how to do an Outlook UI WPF replica, I found many posts about that but each with the same problem, <strong>where is the source code?? The missing..</strong></p>
<p align="justify">So, after some Googlin&#8217; I found it!! Here I whish to share with you the <a href="http://www.microsoft.com/switzerland/msdn/de/presentationfinder/detail.mspx?id=104056" target="_blank">Outlook HOL WPF</a> link I hope someone will find interesting as I do!</p>
<p align="justify">I found starting from an&nbsp; <a href="http://social.msdn.microsoft.com/forums/en-US/wpf/thread/5b591f9e-2cbc-4230-bbdb-c43a3a754240/" target="_blank">MSDN Forum post</a>, as the post describes, the last in the thead, you can download a zip file <strong>WPF.zip</strong> and insied you will the things: Code, Presentations and more!</p>
<p align="justify">Enjoy, Ciao!</p>
<p>Tags: <a href="http://technorati.com/tag/Development, WPF" rel="tag">Development, WPF</a></p>
Posted in Development, WPF Tagged: Development, WPF <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=82&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2008/12/05/developer-news-outlook-hol-wpf-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
		<item>
		<title>Developer Tales n°5- Generic Enum parsing</title>
		<link>http://xmlguy.wordpress.com/2008/12/05/developer-tales-n6-generic-enum-parsing/</link>
		<comments>http://xmlguy.wordpress.com/2008/12/05/developer-tales-n6-generic-enum-parsing/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 15:37:09 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2008/12/05/developer-tales-n6-generic-enum-parsing/</guid>
		<description><![CDATA[Hi,
recently I was doing some code about enum parsing, I think&#160; an operation everyone&#8217;s involved in one time. After some Googlin&#8217; I found some well or not well done examples. Doing a generic parse method is too simple as you can see on Windows.NET Blog post but you don&#8217;t have no type check code or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=79&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi,</p>
<p align="justify">recently I was doing some code about <strong>enum parsing</strong>, I think&nbsp; an operation everyone&#8217;s involved in one time. After some Googlin&#8217; I found some well or not well done examples. Doing a generic <strong>parse</strong> method is too simple as you can see on <a href="http://weblogs.asp.net/wim/archive/2006/07/06/Generic-Parse-method-on-Enum-_2D00_-a-solution.aspx" target="_blank">Windows.NET Blog post</a> but you don&#8217;t have no type check code or constraints, or something about a default check value, so I done my implementation, which assumes that the target enum type has some well defined constraints like: inheriting from the struct base type,&nbsp; having an <strong>Undefined </strong>or a <strong>None</strong> element.. if not the first enum member is assumed as the default one. Here is my little code</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:09da0fcc-d561-4e46-a5a5-9c7605cad5e9" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:White;overflow:auto;">
<div><span style="color:#000000;">    </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
    </span><span style="color:#808080;">///</span><span style="color:#008000;"> Translates from a string name enum member
    </span><span style="color:#808080;">///</span><span style="color:#008000;">  to the given gene ric enumeration Type
    </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">
    </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;param name=&quot;name&quot;&gt;</span><span style="color:#008000;">the name string to translate</span><span style="color:#808080;">&lt;/param&gt;</span><span style="color:#008000;">
    </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;returns&gt;&lt;/returns&gt;</span><span style="color:#808080;">
</span><span style="color:#000000;">    </span><span style="color:#0000FF;">private</span><span style="color:#000000;"> T TranslateFrom</span><span style="color:#000000;">&lt;</span><span style="color:#000000;">T</span><span style="color:#000000;">&gt;</span><span style="color:#000000;">(</span><span style="color:#0000FF;">string</span><span style="color:#000000;"> name)
        </span><span style="color:#0000FF;">where</span><span style="color:#000000;"> T : </span><span style="color:#0000FF;">struct</span><span style="color:#000000;">
    {
        </span><span style="color:#0000FF;">const</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;"> DEFAULT </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">&quot;</span><span style="color:#800000;">Undefined</span><span style="color:#800000;">&quot;</span><span style="color:#000000;">;
        </span><span style="color:#0000FF;">const</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;"> NONE </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">&quot;</span><span style="color:#800000;">None</span><span style="color:#800000;">&quot;</span><span style="color:#000000;">;
        Type enumType </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">typeof</span><span style="color:#000000;">(T);
        T result;
        </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (Enum.IsDefined(enumType, command))
        {
            result </span><span style="color:#000000;">=</span><span style="color:#000000;"> (T)Enum.Parse(enumType, command, </span><span style="color:#0000FF;">true</span><span style="color:#000000;">);
        }
        </span><span style="color:#0000FF;">else</span><span style="color:#000000;">
        {
            </span><span style="color:#0000FF;">string</span><span style="color:#000000;"> defaultName </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;">;
            </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (Enum.IsDefined(enumType, DEFAULT))
                defaultName </span><span style="color:#000000;">=</span><span style="color:#000000;"> DEFAULT;
            </span><span style="color:#0000FF;">else</span><span style="color:#000000;"> </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (Enum.IsDefined(enumType, NONE))
                defaultName </span><span style="color:#000000;">=</span><span style="color:#000000;"> NONE;

            </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (</span><span style="color:#000000;">!</span><span style="color:#0000FF;">string</span><span style="color:#000000;">.IsNullOrEmpty(defaultName))
            { result </span><span style="color:#000000;">=</span><span style="color:#000000;"> (T)Enum.Parse(enumType, command, </span><span style="color:#0000FF;">true</span><span style="color:#000000;">); }
            </span><span style="color:#0000FF;">else</span><span style="color:#000000;">
            {
                </span><span style="color:#0000FF;">string</span><span style="color:#000000;">[] values </span><span style="color:#000000;">=</span><span style="color:#000000;"> Enum.GetNames(enumType);
                result </span><span style="color:#000000;">=</span><span style="color:#000000;"> (T)Enum.Parse(enumType, values[</span><span style="color:#800080;">0</span><span style="color:#000000;">], </span><span style="color:#0000FF;">true</span><span style="color:#000000;">);
            }
        }
        </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> result;
    }
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p align="justify">This is just a little helper method I wish to share, enjoy!</p>
<p align="justify">Ciao</p>
<p>Tags: <a href="http://technorati.com/tag/Development" rel="tag">Development</a></p>
Posted in Development Tagged: Development <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=79&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2008/12/05/developer-tales-n6-generic-enum-parsing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
		<item>
		<title>Developer Tales n°4.1 &#8211; Seralization how-to..</title>
		<link>http://xmlguy.wordpress.com/2008/11/11/developer-tales-n41-seralization-how-to/</link>
		<comments>http://xmlguy.wordpress.com/2008/11/11/developer-tales-n41-seralization-how-to/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 11:28:45 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Serialization]]></category>
		<category><![CDATA[Xml]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/?p=65</guid>
		<description><![CDATA[Hi, as I said in my previous post, I&#8217;m working on a kind of soa-like system, in the system we are exchanging some envelopes messages, something like this:



 1   &#60;Envelope&#62;
 2       &#60;AuthData name=&#34;&#34; pwd=&#34;&#34; /&#62;
 3       &#60;ContextData name=&#34;&#34; /&#62;
 4  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=65&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">Hi, as I said in my previous post, I&#8217;m working on a kind of soa-like system, in the system we are exchanging some envelopes messages, something like this:</p>
<div class="csharpcode">
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:8729863f-99f6-450e-8b14-37b15f2732a1" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:#EAEAEA;overflow:auto;">
<div><span style="color:#008080;"> 1</span> <span style="color:#000000;">  </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">Envelope</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;"> 2</span> <span style="color:#000000;">      </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">AuthData </span><span style="color:#FF0000;">name</span><span style="color:#0000FF;">=&quot;&quot;</span><span style="color:#FF0000;"> pwd</span><span style="color:#0000FF;">=&quot;&quot;</span><span style="color:#FF0000;"> </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;"> 3</span> <span style="color:#000000;">      </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">ContextData </span><span style="color:#FF0000;">name</span><span style="color:#0000FF;">=&quot;&quot;</span><span style="color:#FF0000;"> </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;"> 4</span> <span style="color:#000000;">      </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">Input</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;"> 5</span> <span style="color:#000000;">          </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">FirstNode </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;"> 6</span> <span style="color:#000000;">          </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">FirstNode </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;"> 7</span> <span style="color:#000000;">          </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">SecondNode </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;"> 8</span> <span style="color:#000000;">      </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">Input</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;"> 9</span> <span style="color:#000000;">      </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">Output</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">10</span> <span style="color:#000000;">          </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">ThirdNode </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">11</span> <span style="color:#000000;">          </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">FourthNode </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">12</span> <span style="color:#000000;">          </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">FourthNode </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">13</span> <span style="color:#000000;">      </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">Output</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">14</span> <span style="color:#000000;">  </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">Envelope</span><span style="color:#0000FF;">&gt;</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
</div>
<p align="justify">In my previous post <a href="http://xmlguy.wordpress.com/2008/10/27/developer-tales-n4-xml-default-serialization/" target="_blank">Xml Default serialization</a> I was talking about some serialization problems I found, especialy with serializing collections. I have to say that the Service, the remote service is an old-style ASMX Web Service, wich accept a string parameter and returns a string representing the output message. Well, while I was coding up a client to that service, I tried, first, to evolve the <strong>Client</strong> using a WCF style proxy, we know it&#8217;s truly possible to call an ASMX service from with a WCF client, but talking about the client proxy I made is out of the scope of this post.</p>
<p align="justify">Well, I made a Proxy library with a Proxy client and some Objects, well..Contracts, describing the solution and then using a DataContractSerializer in conjunction with an XmlSerializer to serialize-deserialize messages regarding the <strong>simple-and-raw</strong> message string representation which the Service expect..</p>
<p align="justify">So, the First problem was, How to create a DataContract object with a Input and Output DataMembers properties which could accept any kind of object? This because, clearly, I can send in the envelope any operation-request and expect the related operation-response..but how can I put them in to the evelope-DataContract-Object?? after some search I realized that the better thing was to accept in the <strong>Input</strong> and in the <strong>Output</strong> DataMember properties an xml String, so the things are:</p>
<ol>
<li>
<div align="justify">create the Message object</div>
</li>
<li>
<div align="justify">create the Operation object</div>
</li>
<li>
<div align="justify">serialize with an XmlSerializer the operation itself and put the result in the <strong>Input</strong> part of the Message previously created</div>
</li>
</ol>
<p align="justify">But, when I tried to do as above, I fall into a <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx" target="_blank">DataContractSerializer</a> behavior wich will &quot;encode&quot; the xml string, so the string instead of been passed for example as &quot;<strong>&lt;xml&gt;&lt;/xml&gt;</strong>&quot; is passed as &quot;<strong>&amp;lt;xml&amp;gt;&amp;lt;/xml&amp;gt;&quot;</strong>, it&#8217;s clear that the encode xml string will not be accepted as a valid xml, so what could I try more?</p>
<p align="justify">A developer team I was working with, take the solution using an XmlDocument and let it be serialized-deserialized by the serializer, but I don&#8217;t really love this solution nor the XmlDocument itself for many reasons, then I took a solution from a forum-port I found on the net regarding a problem as mine, how to serialize a raw-xml string without involve in <strong>encoding-issue </strong>which is not an Issue but in my case it was..</p>
<p align="justify">so here is the solution, the brilliant one (I cannot find where I put the original forum-post-idea link), the solution is mixing the <a href="http://msdn.microsoft.com/it-it/library/system.xml.serialization.ixmlserializable(VS.80).aspx" target="_blank">IXmlSerializable</a> and the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx" target="_blank">DataContractSerializer</a> serialization. The DataContractSerializer we know will serialize DataContracts, DataMembers and more, even types marked as inheriting from <strong>IXmlSerializable</strong>, so using an object of that type as a <strong>DataMember</strong> of my Message-envelope will produce a well defined, not encoded xml string. The thing is made using <strong>implicit operators</strong> which will do the magic of translating an xml string to and from this kind of object.</p>
<p align="justify">I named the object <strong>XmlRawData</strong> because it represent a special place-holder object to represent an xml string inside a DataMember representation, but here is the code:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:e36f6840-0bb5-4d2d-8a4d-0c246a577696" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:White;overflow:none;">
<div><span style="color:#008080;">  1</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">using</span><span style="color:#000000;"> System.Xml;
</span><span style="color:#008080;">  2</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">using</span><span style="color:#000000;"> System.Xml.Schema;
</span><span style="color:#008080;">  3</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">using</span><span style="color:#000000;"> System.Xml.Serialization;
</span><span style="color:#008080;">  4</span> <span style="color:#000000;">
</span><span style="color:#008080;">  5</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">namespace</span><span style="color:#000000;"> XGuy.Common.Serialization
</span><span style="color:#008080;">  6</span> <span style="color:#000000;"> {
</span><span style="color:#008080;">  7</span> <span style="color:#000000;">     </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">  8</span> <span style="color:#008000;">     </span><span style="color:#808080;">///</span><span style="color:#008000;"> Rpresent a wrapper-placeholder for raw xml string
</span><span style="color:#008080;">  9</span> <span style="color:#008000;">     </span><span style="color:#808080;">///</span><span style="color:#008000;"> representation where is not possible to use direct
</span><span style="color:#008080;"> 10</span> <span style="color:#008000;">     </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;b&gt;</span><span style="color:#008000;">string</span><span style="color:#808080;">&lt;/b&gt;</span><span style="color:#008000;"> data type
</span><span style="color:#008080;"> 11</span> <span style="color:#008000;">     </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">      </span><span style="color:#808080;">
</span><span style="color:#008080;"> 12</span> <span style="color:#808080;"></span><span style="color:#000000;">     </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">class</span><span style="color:#000000;"> XmlRawData : IXmlSerializable
</span><span style="color:#008080;"> 13</span> <span style="color:#000000;">     {
</span><span style="color:#008080;"> 14</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 15</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> implicit operator from </span><span style="color:#808080;">&lt;b&gt;</span><span style="color:#008000;">XmlRawData</span><span style="color:#808080;">&lt;/b&gt;</span><span style="color:#008000;"> to </span><span style="color:#808080;">&lt;b&gt;</span><span style="color:#008000;">string</span><span style="color:#808080;">&lt;/b&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 16</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 17</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;param name=&quot;item&quot;&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 18</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;">  the XmlRawData instance to convert
</span><span style="color:#008080;"> 19</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/param&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 20</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;returns&gt;</span><span style="color:#008000;">the content string</span><span style="color:#808080;">&lt;/returns&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;"> 21</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">static</span><span style="color:#000000;"> </span><span style="color:#0000FF;">implicit</span><span style="color:#000000;"> </span><span style="color:#0000FF;">operator</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;">(XmlRawData item)
</span><span style="color:#008080;"> 22</span> <span style="color:#000000;">         {
</span><span style="color:#008080;"> 23</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> item </span><span style="color:#000000;">==</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;"> </span><span style="color:#000000;">?</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;"> : item.Content;
</span><span style="color:#008080;"> 24</span> <span style="color:#000000;">         }
</span><span style="color:#008080;"> 25</span> <span style="color:#000000;">
</span><span style="color:#008080;"> 26</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 27</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> implicit operator from </span><span style="color:#808080;">&lt;b&gt;</span><span style="color:#008000;">string</span><span style="color:#808080;">&lt;/b&gt;</span><span style="color:#008000;"> to </span><span style="color:#808080;">&lt;b&gt;</span><span style="color:#008000;">XmlRawData</span><span style="color:#808080;">&lt;/b&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 28</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 29</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;param name=&quot;content&quot;&gt;</span><span style="color:#008000;">the xml raw string to convert
</span><span style="color:#008080;"> 30</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> and wrap with an XmlRawData object</span><span style="color:#808080;">&lt;/param&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 31</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;returns&gt;</span><span style="color:#008000;">the XmlRawData object</span><span style="color:#808080;">&lt;/returns&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;"> 32</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">static</span><span style="color:#000000;"> </span><span style="color:#0000FF;">implicit</span><span style="color:#000000;"> </span><span style="color:#0000FF;">operator</span><span style="color:#000000;"> XmlRawData(</span><span style="color:#0000FF;">string</span><span style="color:#000000;"> content)
</span><span style="color:#008080;"> 33</span> <span style="color:#000000;">        {
</span><span style="color:#008080;"> 34</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> content </span><span style="color:#000000;">==</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;"> </span><span style="color:#000000;">?</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;"> : </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> XmlRawData(content);
</span><span style="color:#008080;"> 35</span> <span style="color:#000000;">         }
</span><span style="color:#008080;"> 36</span> <span style="color:#000000;">
</span><span style="color:#008080;"> 37</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 38</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Gets or sets the string content of the object
</span><span style="color:#008080;"> 39</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;"> 40</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;"> Content
</span><span style="color:#008080;"> 41</span> <span style="color:#000000;">         {
</span><span style="color:#008080;"> 42</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">get</span><span style="color:#000000;"> { </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> _content; }
</span><span style="color:#008080;"> 43</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">set</span><span style="color:#000000;">{ _content </span><span style="color:#000000;">=</span><span style="color:#000000;"> value;}
</span><span style="color:#008080;"> 44</span> <span style="color:#000000;">         }
</span><span style="color:#008080;"> 45</span> <span style="color:#000000;">
</span><span style="color:#008080;"> 46</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">internal content string placeholder</span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;"> 47</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">private</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;"> _content;
</span><span style="color:#008080;"> 48</span> <span style="color:#000000;">
</span><span style="color:#008080;"> 49</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 50</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Creates a new </span><span style="color:#808080;">&lt;b&gt;</span><span style="color:#008000;">XmlRawData</span><span style="color:#808080;">&lt;/b&gt;</span><span style="color:#008000;"> instance
</span><span style="color:#008080;"> 51</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;"> 52</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> XmlRawData()
</span><span style="color:#008080;"> 53</span> <span style="color:#000000;">         {}
</span><span style="color:#008080;"> 54</span> <span style="color:#000000;">
</span><span style="color:#008080;"> 55</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 56</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Creates a new </span><span style="color:#808080;">&lt;b&gt;</span><span style="color:#008000;">XmlRawData</span><span style="color:#808080;">&lt;/b&gt;</span><span style="color:#008000;"> instance
</span><span style="color:#008080;"> 57</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 58</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;param name=&quot;content&quot;&gt;</span><span style="color:#008000;">the raw xml string to wrap</span><span style="color:#808080;">&lt;/param&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;"> 59</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> XmlRawData(</span><span style="color:#0000FF;">string</span><span style="color:#000000;"> content)
</span><span style="color:#008080;"> 60</span> <span style="color:#000000;">         {
</span><span style="color:#008080;"> 61</span> <span style="color:#000000;">             _content </span><span style="color:#000000;">=</span><span style="color:#000000;"> content;
</span><span style="color:#008080;"> 62</span> <span style="color:#000000;">         }
</span><span style="color:#008080;"> 63</span> <span style="color:#000000;">
</span><span style="color:#008080;"> 64</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 65</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Get the schema instance of the schema
</span><span style="color:#008080;"> 66</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> related to the content
</span><span style="color:#008080;"> 67</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> string
</span><span style="color:#008080;"> 68</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 69</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;returns&gt;</span><span style="color:#008000;">a null reference</span><span style="color:#808080;">&lt;/returns&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;"> 70</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> XmlSchema GetSchema()
</span><span style="color:#008080;"> 71</span> <span style="color:#000000;">         {
</span><span style="color:#008080;"> 72</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> </span><span style="color:#0000FF;">null</span><span style="color:#000000;">;
</span><span style="color:#008080;"> 73</span> <span style="color:#000000;">         }
</span><span style="color:#008080;"> 74</span> <span style="color:#000000;">
</span><span style="color:#008080;"> 75</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 76</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Read from an xml reader the raw xml string content
</span><span style="color:#008080;"> 77</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> previous serialized
</span><span style="color:#008080;"> 78</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 79</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;param name=&quot;reader&quot;&gt;&lt;/param&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 80</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;remarks&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;"> 81</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Here is the first part of the magic of the object which
</span><span style="color:#008080;"> 82</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> will take the inner xml of the containing xml and
</span><span style="color:#008080;"> 83</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> reads it
</span><span style="color:#008080;"> 84</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> into the inner content placeholder preventing the
</span><span style="color:#008080;"> 85</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> encoding-decoding steps
</span><span style="color:#008080;"> 86</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/remarks&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;"> 87</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">void</span><span style="color:#000000;"> ReadXml(XmlReader reader)
</span><span style="color:#008080;"> 88</span> <span style="color:#000000;">         {
</span><span style="color:#008080;"> 89</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">if</span><span style="color:#000000;"> (reader.IsEmptyElement)
</span><span style="color:#008080;"> 90</span> <span style="color:#000000;">             { _content </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;">.Empty; }
</span><span style="color:#008080;"> 91</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">else</span><span style="color:#000000;">
</span><span style="color:#008080;"> 92</span> <span style="color:#000000;">             {
</span><span style="color:#008080;"> 93</span> <span style="color:#000000;">                 </span><span style="color:#0000FF;">switch</span><span style="color:#000000;"> (reader.NodeType)
</span><span style="color:#008080;"> 94</span> <span style="color:#000000;">                 {
</span><span style="color:#008080;"> 95</span> <span style="color:#000000;">                     </span><span style="color:#0000FF;">case</span><span style="color:#000000;"> XmlNodeType.EndElement:
</span><span style="color:#008080;"> 96</span> <span style="color:#000000;">                         _content </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;">.Empty; </span><span style="color:#0000FF;">break</span><span style="color:#000000;">;
</span><span style="color:#008080;"> 97</span> <span style="color:#000000;">                     </span><span style="color:#0000FF;">case</span><span style="color:#000000;"> XmlNodeType.Element:
</span><span style="color:#008080;"> 98</span> <span style="color:#000000;">                         _content </span><span style="color:#000000;">=</span><span style="color:#000000;"> reader.ReadInnerXml();
</span><span style="color:#008080;"> 99</span> <span style="color:#000000;">                        </span><span style="color:#0000FF;">break</span><span style="color:#000000;">;
</span><span style="color:#008080;">100</span> <span style="color:#000000;">                 }
</span><span style="color:#008080;">101</span> <span style="color:#000000;">             }
</span><span style="color:#008080;">102</span> <span style="color:#000000;">         }
</span><span style="color:#008080;">103</span> <span style="color:#000000;">
</span><span style="color:#008080;">104</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">105</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Writes the raw xml string into an </span><span style="color:#808080;">&lt;see cref=&quot;XmlWriter&quot;/&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">106</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">107</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;param name=&quot;writer&quot;&gt;&lt;/param&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">108</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;remarks&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">109</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Here is the second part of the magic of the object which
</span><span style="color:#008080;">110</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> will take the raw xml string and writes out with the
</span><span style="color:#008080;">111</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> WriteRaw method this preventing the
</span><span style="color:#008080;">112</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> encoding-decoding steps so the xml result clear
</span><span style="color:#008080;">113</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/remarks&gt;</span><span style="color:#008000;"> </span><span style="color:#808080;">
</span><span style="color:#008080;">114</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">void</span><span style="color:#000000;"> WriteXml(XmlWriter writer)
</span><span style="color:#008080;">115</span> <span style="color:#000000;">         {
</span><span style="color:#008080;">116</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">if</span><span style="color:#000000;">(</span><span style="color:#000000;">!</span><span style="color:#0000FF;">string</span><span style="color:#000000;">.IsNullOrEmpty(_content))
</span><span style="color:#008080;">117</span> <span style="color:#000000;">                 writer.WriteRaw(_content);
</span><span style="color:#008080;">118</span> <span style="color:#000000;">         }
</span><span style="color:#008080;">119</span> <span style="color:#000000;">
</span><span style="color:#008080;">120</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">121</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Returns the inner raw xml string
</span><span style="color:#008080;">122</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">123</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> </span><span style="color:#808080;">&lt;returns&gt;&lt;/returns&gt;</span><span style="color:#008000;"> </span><span style="color:#808080;">
</span><span style="color:#008080;">124</span> <span style="color:#808080;"></span><span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">override</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;"> ToString()
</span><span style="color:#008080;">125</span> <span style="color:#000000;">         {
</span><span style="color:#008080;">126</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">return</span><span style="color:#000000;"> Content;
</span><span style="color:#008080;">127</span> <span style="color:#000000;">         }
</span><span style="color:#008080;">128</span> <span style="color:#000000;">     }
</span><span style="color:#008080;">129</span> <span style="color:#000000;">}</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p align="justify">The above code shows how we can avoid the raw xml encoding step during the serialization, but let explaing and showing it with an usage example:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:73f8d0fc-2cd0-472e-8276-9fc3d0997e86" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:White;overflow:none;">
<div><span style="color:#008080;"> 1</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">using</span><span style="color:#000000;"> System.ServiceModel;
</span><span style="color:#008080;"> 2</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">using</span><span style="color:#000000;"> System.Runtime.Serialization;
</span><span style="color:#008080;"> 3</span> <span style="color:#000000;">
</span><span style="color:#008080;"> 4</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">namespace</span><span style="color:#000000;"> XGuy.Common.Serialization.Test
</span><span style="color:#008080;"> 5</span> <span style="color:#000000;"> {
</span><span style="color:#008080;"> 6</span> <span style="color:#000000;">     </span><span style="color:#008000;">//</span><span style="color:#008000;">first of all define a DataContract which will
</span><span style="color:#008080;"> 7</span> <span style="color:#008000;">     </span><span style="color:#008000;">//</span><span style="color:#008000;">contains the xml raw DataMember property   </span><span style="color:#008000;">
</span><span style="color:#008080;"> 8</span> <span style="color:#008000;"></span><span style="color:#000000;">
</span><span style="color:#008080;"> 9</span> <span style="color:#000000;">     [DataContract(Namespace </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">&quot;</span><span style="color:#800000;">http://xguy.serialization/2008/11</span><span style="color:#800000;">&quot;</span><span style="color:#000000;">)]
</span><span style="color:#008080;">10</span> <span style="color:#000000;">     </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">class</span><span style="color:#000000;"> SimpleEnvelope
</span><span style="color:#008080;">11</span> <span style="color:#000000;">     {
</span><span style="color:#008080;">12</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">13</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Contains the envelope operation name
</span><span style="color:#008080;">14</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;">15</span> <span style="color:#808080;"></span><span style="color:#000000;">         [DataMember()]
</span><span style="color:#008080;">16</span> <span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">string</span><span style="color:#000000;"> Name { </span><span style="color:#0000FF;">get</span><span style="color:#000000;">; </span><span style="color:#0000FF;">set</span><span style="color:#000000;">; }
</span><span style="color:#008080;">17</span> <span style="color:#000000;">
</span><span style="color:#008080;">18</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">19</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Contains the envelope input data xml
</span><span style="color:#008080;">20</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;">21</span> <span style="color:#808080;"></span><span style="color:#000000;">         [DataMember()]
</span><span style="color:#008080;">22</span> <span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> XmlRawData Input { </span><span style="color:#0000FF;">get</span><span style="color:#000000;">; </span><span style="color:#0000FF;">set</span><span style="color:#000000;">; }
</span><span style="color:#008080;">23</span> <span style="color:#000000;">
</span><span style="color:#008080;">24</span> <span style="color:#000000;">         </span><span style="color:#808080;">///</span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">25</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#008000;"> Contains the envelope output data xml
</span><span style="color:#008080;">26</span> <span style="color:#008000;">         </span><span style="color:#808080;">///</span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;">27</span> <span style="color:#808080;"></span><span style="color:#000000;">         [DataMember(EmitDefaultValue </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">false</span><span style="color:#000000;">)]
</span><span style="color:#008080;">28</span> <span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> XmlRawData Output { </span><span style="color:#0000FF;">get</span><span style="color:#000000;">; </span><span style="color:#0000FF;">set</span><span style="color:#000000;">; }
</span><span style="color:#008080;">29</span> <span style="color:#000000;">     }
</span><span style="color:#008080;">30</span> <span style="color:#000000;">
</span><span style="color:#008080;">31</span> <span style="color:#000000;">     </span><span style="color:#808080;">///</span><span style="color:#808080;">&lt;summary&gt;</span><span style="color:#008000;">
</span><span style="color:#008080;">32</span> <span style="color:#008000;">     </span><span style="color:#808080;">///</span><span style="color:#008000;"> Simple test class
</span><span style="color:#008080;">33</span> <span style="color:#008000;">     </span><span style="color:#808080;">///</span><span style="color:#808080;">&lt;/summary&gt;</span><span style="color:#008000;">  </span><span style="color:#808080;">
</span><span style="color:#008080;">34</span> <span style="color:#808080;"></span><span style="color:#000000;">     </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">class</span><span style="color:#000000;"> XmlRawDataTest()
</span><span style="color:#008080;">35</span> <span style="color:#000000;">     {
</span><span style="color:#008080;">36</span> <span style="color:#000000;">         </span><span style="color:#0000FF;">public</span><span style="color:#000000;"> </span><span style="color:#0000FF;">void</span><span style="color:#000000;"> Run()
</span><span style="color:#008080;">37</span> <span style="color:#000000;">         {
</span><span style="color:#008080;">38</span> <span style="color:#000000;">             </span><span style="color:#008000;">//</span><span style="color:#008000;">now I can do something like this  </span><span style="color:#008000;">
</span><span style="color:#008080;">39</span> <span style="color:#008000;"></span><span style="color:#000000;">             SimpleEnvelope env </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> SimpleEvelope()
</span><span style="color:#008080;">40</span> <span style="color:#000000;">             {
</span><span style="color:#008080;">41</span> <span style="color:#000000;">                 Name </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">&quot;</span><span style="color:#800000;">TestOperation</span><span style="color:#800000;">&quot;</span><span style="color:#000000;">,
</span><span style="color:#008080;">42</span> <span style="color:#000000;">                 Input </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">@&quot;</span><span style="color:#800000;">&lt;Operation&gt;&lt;Data&gt;Test data
</span><span style="color:#008080;">43</span> <span style="color:#800000;">                                        content&lt;/Data&gt;&lt;/Operation&gt;</span><span style="color:#800000;">&quot;</span><span style="color:#000000;">
</span><span style="color:#008080;">44</span> <span style="color:#000000;">             };
</span><span style="color:#008080;">45</span> <span style="color:#000000;">
</span><span style="color:#008080;">46</span> <span style="color:#000000;">             StringBuilder buffer
</span><span style="color:#008080;">47</span> <span style="color:#000000;">                 </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> StringBuilder();
</span><span style="color:#008080;">48</span> <span style="color:#000000;">
</span><span style="color:#008080;">49</span> <span style="color:#000000;">             XmlWriterSettings settings </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> XmlWriterSettings();
</span><span style="color:#008080;">50</span> <span style="color:#000000;">             settings.OmitXmlDeclaration </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">true</span><span style="color:#000000;">;
</span><span style="color:#008080;">51</span> <span style="color:#000000;">
</span><span style="color:#008080;">52</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">using</span><span style="color:#000000;"> (StringWriter writer  </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> StringWriter(buffer))
</span><span style="color:#008080;">53</span> <span style="color:#000000;">             </span><span style="color:#0000FF;">using</span><span style="color:#000000;"> (XmlWriter xwriter    </span><span style="color:#000000;">=</span><span style="color:#000000;">
</span><span style="color:#008080;">54</span> <span style="color:#000000;">                           XmlDictionaryWriter.Create(writer, settings))
</span><span style="color:#008080;">55</span> <span style="color:#000000;">             {
</span><span style="color:#008080;">56</span> <span style="color:#000000;">
</span><span style="color:#008080;">57</span> <span style="color:#000000;">                 DataContractSerializer ser </span><span style="color:#000000;">=</span><span style="color:#000000;">
</span><span style="color:#008080;">58</span> <span style="color:#000000;">                    </span><span style="color:#0000FF;">new</span><span style="color:#000000;"> DataContractSerializer(</span><span style="color:#0000FF;">typeof</span><span style="color:#000000;">(SimpleEnvelope));
</span><span style="color:#008080;">59</span> <span style="color:#000000;">                 ser.WriteObject(xwriter, env);
</span><span style="color:#008080;">60</span> <span style="color:#000000;">                 xwriter.Flush();
</span><span style="color:#008080;">61</span> <span style="color:#000000;">             }
</span><span style="color:#008080;">62</span> <span style="color:#000000;">
</span><span style="color:#008080;">63</span> <span style="color:#000000;">             Console.WriteLine(buffer.ToString());
</span><span style="color:#008080;">64</span> <span style="color:#000000;">         }
</span><span style="color:#008080;">65</span> <span style="color:#000000;">     }
</span><span style="color:#008080;">66</span> <span style="color:#000000;"> }</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>So the result written out in the console will be:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:c23737d1-ff20-441c-ae7d-08cef720eff6" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:White;overflow:auto;">
<div><span style="color:#008080;">1</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">SimpleEnvelope
</span><span style="color:#008080;">2</span> <span style="color:#800000;">     </span><span style="color:#FF0000;">xmlns</span><span style="color:#0000FF;">=&quot;http://xguy.serialization/2008/11&quot;</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">3</span> <span style="color:#000000;">     </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">Name</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">TestOperation</span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">Name</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">4</span> <span style="color:#000000;">     </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">Input</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">5</span> <span style="color:#000000;">     </span><span style="color:#008000;">&lt;!--</span><span style="color:#008000;"> this is the raw xml added part </span><span style="color:#008000;">--&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">6</span> <span style="color:#000000;">         </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">Operation</span><span style="color:#0000FF;">&gt;&lt;</span><span style="color:#800000;">Data</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">Test data content</span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">Data</span><span style="color:#0000FF;">&gt;&lt;/</span><span style="color:#800000;">Operation</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">7</span> <span style="color:#000000;">     </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">Input</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008080;">8</span> <span style="color:#000000;"> </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">SimpleEnvelope</span><span style="color:#0000FF;">/&gt;</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>instead of the following without the XmlRawData object:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:e0d0b207-e5e1-4e90-babe-a6203587a9e5" style="display:inline;float:none;margin:0;padding:0;">
<pre style="background-color:White;overflow:none;">
<div><span style="color:#000000;"> </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">SimpleEnvelope
     </span><span style="color:#FF0000;">xmlns</span><span style="color:#0000FF;">=&quot;http://xguy.serialization/2008/11&quot;</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
     </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">Name</span><span style="color:#0000FF;">&gt;&lt;/</span><span style="color:#800000;">Name</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
     </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">Input</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
     </span><span style="color:#008000;">&lt;!--</span><span style="color:#008000;"> this is the encoded raw xml added part</span><span style="color:#008000;">--&gt;</span><span style="color:#000000;">
         </span><span style="color:#FF0000;">&amp;lt;</span><span style="color:#000000;">Operation</span><span style="color:#FF0000;">&amp;gt;&amp;lt;</span><span style="color:#000000;">Data</span><span style="color:#FF0000;">&amp;gt;</span><span style="color:#000000;">Test
              data content</span><span style="color:#FF0000;">&amp;lt;</span><span style="color:#000000;">/Data</span><span style="color:#FF0000;">&amp;gt;&amp;lt;</span><span style="color:#000000;">/Operation</span><span style="color:#FF0000;">&amp;gt;</span><span style="color:#000000;">
     </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">Input</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
 </span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">SimpleEnvelope</span><span style="color:#0000FF;">&gt;</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>the difference it&#8217;s clear and no needs of more explain! Hope this Helps!</p>
<p>Ciao!</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9ee8b25b-13e0-4cf0-8027-8302fafa822f" style="display:inline;margin:0;padding:0;">Technorati Tag: <a href="http://technorati.com/tags/Developer%20Tales" rel="tag">Developer Tales</a>,<a href="http://technorati.com/tags/Xml" rel="tag">Xml</a>,<a href="http://technorati.com/tags/Serialization" rel="tag">Serialization</a>,<a href="http://technorati.com/tags/WCF" rel="tag">WCF</a></div>
Posted in Development, Serialization, Xml Tagged: Development, Serialization, Xml <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=65&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2008/11/11/developer-tales-n41-seralization-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
		<item>
		<title>Developer Tales n&#176;4 &#8211; Xml (Default) Serialization</title>
		<link>http://xmlguy.wordpress.com/2008/10/27/developer-tales-n4-xml-default-serialization/</link>
		<comments>http://xmlguy.wordpress.com/2008/10/27/developer-tales-n4-xml-default-serialization/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 19:13:19 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Developer Tales]]></category>
		<category><![CDATA[Xml]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2008/10/27/developer-tales-n4-xml-default-serialization/</guid>
		<description><![CDATA[&#160;
I&#8217;m working on a &#8220;SOA-Like&#8221; system, which lives and exchange data in the xml-envelope form which many of us knows as 

   1: &#60;Envelope&#62;
   2:     &#60;AuthData name="" pwd="" /&#62;
   3:     &#60;ContextData name="" /&#62;
   4:     &#60;Input&#62;
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=63&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div>&nbsp;</div>
<p align="justify">I&#8217;m working on a &#8220;SOA-Like&#8221; system, which lives and exchange data in the xml-envelope form which many of us knows as </p>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Envelope</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">AuthData</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">=""</span> <span style="color:#ff0000;">pwd</span><span style="color:#0000ff;">=""</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ContextData</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">=""</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Input</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FirstNode</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FirstNode</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">SecondNode</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Input</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Output</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ThirdNode</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FourthNode</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FourthNode</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Output</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Envelope</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<p>I&#8217;m starting from an xsd schema which describes the envelope and each &#8220;Message&#8221; which will be enclosed in the &#8220;Input&#8221; part, then the operation-result message will be returned as a child of &#8220;Output&#8221; node. Until now everything could be fine, a standard Envelope, ESB-Message, or what else you want to name it, but a standard situation. But here my problems begins. </p>
<p align="justify">First of all, I cannot use a DataContract-fashion-class and the DataContractSerializer, because for the DataContract context it&#8217;s impossible to render an xml as above where child nodes are &#8220;variables&#8221; in the sense of I have a container, in my case the &#8220;Input&#8221; Object, which could have childs, maybe represented by a form of xmltype-anonymoustype array of objects, every time I can write a collection, an array in the form of:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Input</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FirstNodeCollection</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FirstNode</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">FirstNode</span> <span style="color:#0000ff;">/&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">FirstNodeCollection</span><span style="color:#0000ff;">&gt;</span></pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Input</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
</div>
<p align="justify">in this way my objects hierarchy must be InputObject -&gt; FirstNodeCollection -&gt; FirtsNodeObject. I hate this way of representing the objects, but DataContract-fashion-classes and DataContractSerializer, could not produce a different &#8220;rendering&#8221;</p>
<p align="justify">Second, If I want to use the XmlSerializer instead of the DataContractSerializer, first I have to fill my classes of a lot of attributes, and even here, I can have some troubles, even if the only object which natively support the above representation is just the XmlSerializer.</p>
<p align="justify">Well, the XmlSerializer could help me, but the first thing which makes me hate it, is the fact that for each Type which it&#8217;ll represent, the XmlSerializer will generate a Temp assembly containing the ad-hoc serializer for that Type, and this is the thing which makes me really angry and hungry..of what?? of a normal, well driven, serialization API!</p>
<p align="justify">Personally I don&#8217;t know which makes Microsoft to choiche this kind of implementation about the DataContractSerializer, but I cannot believe there&#8217;s not an easy, more customizable way of doing it. Yes, someone could say me : &#8220;Hey, look at the IXmlSerializable interface&#8221; but this is a RAW implementation, this makes me think an Italian way to say, (..orrible translation..) &#8220;doing everything or doing nothing&#8221;, I try to explain it.. saying this I&#8217;m saying that Microsoft could makes a Monster, complicated over-rich API, or a simplest, it doesn&#8217;t know a &#8220;middle way&#8221; of doing things.</p>
<p align="justify">So, here I&#8217;m starting my provocation: why we cannot implement a simple new serialization API? maybe we could make in the beginning simple, and then let it grow and become more complicated! Maybe we could learn something from some JAVA implementation&#8230; I hope I can find anyone which wants to talk about, and maybe, start to think to implement something!</p>
<p align="justify">Ciao</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e5c5dfbe-4120-4c16-bb4f-b4a3b973bba1" style="display:inline;margin:0;padding:0;">Technorati Tag: <a href="http://technorati.com/tags/Developer%20Tales" rel="tag">Developer Tales</a>,<a href="http://technorati.com/tags/Xml" rel="tag">Xml</a></div>
Posted in Developer Tales, Xml Tagged: Development, Xml <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=63&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2008/10/27/developer-tales-n4-xml-default-serialization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
		<item>
		<title>Working Facts: Installing Team Foundation Server (Question)</title>
		<link>http://xmlguy.wordpress.com/2008/09/25/working-facts-installing-team-foundation-server-question/</link>
		<comments>http://xmlguy.wordpress.com/2008/09/25/working-facts-installing-team-foundation-server-question/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 09:37:41 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Team System]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2008/09/25/working-facts-installing-team-foundation-server-question/</guid>
		<description><![CDATA[&#160;
Hi, now, while I&#8217;ve changed the project I&#8217;m working on, has been assigned to me a new, strange for myself, task: installing a new Team Foundation Server from scratch and migrating source control from VSS 2005 to Team Foundation. I can&#8217;t hide I&#8217;m a bit worried about, &#8217;cause I know It&#8217;s not trivial task, I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=58&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&nbsp;</p>
<p>Hi, now, while I&#8217;ve changed the project I&#8217;m working on, has been assigned to me a new, strange for myself, task: installing a new Team Foundation Server from scratch and migrating source control from VSS 2005 to Team Foundation. I can&#8217;t hide I&#8217;m a bit worried about, &#8217;cause I know It&#8217;s not trivial task, I read all the planning and installation check lists, I saw a big area of work&#8230; I hope I can accomplish in a week, but I hope maybe less, I don&#8217;t now, so know I wish to ask to you, to everybody has done before, or still working on, if my time &#8220;plan&#8221; is correct and what kind of &#8220;dangerous things&#8221; I can expect, so please comment or send me a message about! </p>
<p>After I will say what has been my experience!</p>
<p>Ciao</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a9cdcb14-4070-4e47-a55f-e6bf24e76ace" style="display:inline;margin:0;padding:0;">Technorati Tag: <a href="http://technorati.com/tags/Team%20System" rel="tag">Team System</a>,<a href="http://technorati.com/tags/Work" rel="tag">Work</a></div>
Posted in Team System, Work Tagged: Team System, Work <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=58&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2008/09/25/working-facts-installing-team-foundation-server-question/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
		<item>
		<title>Technology Facts: ..and finally it arrives!</title>
		<link>http://xmlguy.wordpress.com/2008/09/17/technology-facts-and-finally-it-arrives/</link>
		<comments>http://xmlguy.wordpress.com/2008/09/17/technology-facts-and-finally-it-arrives/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 08:12:16 +0000</pubDate>
		<dc:creator>hoghweed</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://xmlguy.wordpress.com/2008/09/17/technology-facts-and-finally-it-arrives/</guid>
		<description><![CDATA[&#160;
Hi!
Today when I&#8217;m starting to do my &#8220;dirty&#8221; job on this project it will never end&#8230;I hope it&#8217;ll end soon&#8230;I found that news which makes me very happy, next year Plastic Logic will release the first, REAL, eBook reader, very thin, usefull and lightweigth.. All the products released till now are some kind of &#8220;work-around&#8221;.. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=56&subd=xmlguy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&nbsp;</p>
<p>Hi!</p>
<p align="justify">Today when I&#8217;m starting to do my &#8220;dirty&#8221; job on this project it will never end&#8230;I hope it&#8217;ll end soon&#8230;I found that news which makes me very happy, next year <a title="Plastic Logic" href="http://www.plasticlogic.com/" target="_blank">Plastic Logic</a> will release the first, REAL, eBook reader, very thin, usefull and lightweigth.. All the products released till now are some kind of &#8220;work-around&#8221;.. but instead this from plastic logic is very cool. This make me happy first of all I love technology when it gives help to the folks and to earth (how much paper we will save&#8230;) and then because this open the way to REAL electronic data exchange, I imagine services which makes me possible to buy a newspaper when I&#8217;m near the &#8220;seller&#8221;, or I can by a book with a click, download it and read it fluid..</p>
<p align="justify">Here the link the news I read this morning (in italian) at <a title="Futurix" href="http://www.futurix.it/2008/09/2009-il-giornale-diventa-elettronico.html" target="_blank">Futurix Blog</a></p>
<p align="justify">While waiting for this new piece of tech, enjoy!</p>
<p align="justify">Ciao!</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4a68746e-3b92-4188-ba46-c9ce7f230a78" style="display:inline;margin:0;padding:0;">Technorati Tag: <a href="http://technorati.com/tags/Technology" rel="tag">Technology</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/xmlguy.wordpress.com/56/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/xmlguy.wordpress.com/56/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xmlguy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xmlguy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xmlguy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xmlguy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xmlguy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xmlguy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xmlguy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xmlguy.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xmlguy.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xmlguy.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xmlguy.wordpress.com&blog=3433845&post=56&subd=xmlguy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xmlguy.wordpress.com/2008/09/17/technology-facts-and-finally-it-arrives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/726fa98f6881ef3c987a998a2064546c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hoghweed</media:title>
		</media:content>
	</item>
	</channel>
</rss>