tag:blogger.com,1999:blog-2441850399540300710.post349814669293679547..comments2024-02-17T03:47:06.818-08:00Comments on CraigBlog: System.Xml 2.0 = CoolnessCraig Anderahttp://www.blogger.com/profile/17084199593129216563noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-2441850399540300710.post-54929764173781339922005-01-05T02:29:00.000-08:002005-01-05T02:29:00.000-08:00More functionel classes are always welcome :-)More functionel classes are always welcome :-)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2441850399540300710.post-10458758940045196892005-01-04T04:29:00.000-08:002005-01-04T04:29:00.000-08:00Not significantly different, no. But isn't it ...Not significantly different, no. But isn't it nice when common paradigms are captured? It shows they "get it".Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2441850399540300710.post-69561670119963163032005-01-04T03:18:00.000-08:002005-01-04T03:18:00.000-08:00Is there a big difference from using the XmlSerial...Is there a big difference from using the XmlSerializer?<br /><br><br /><br>[code] //where the node is the object-"root"<br /><br>XmlSerializer serializer = new XmlSerializer(typeof(MyClass));<br /><br><br /><br>XmlNodeReader reader = new XmlNodeReader(node);<br /><br>object fetchedObject = serializer.Deserialize(reader);Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2441850399540300710.post-45700510739341063022004-03-31T01:54:00.000-08:002004-03-31T01:54:00.000-08:00That's excellent! But I have one question: wh...That's excellent! But I have one question: why can't I do this?:<br /><br /> Book book = reader.ReadAsObject < Book > ();<br /><br />What's with all this casting, in a world with generics? (Of course what you really want is for the template parameter to be inferred, but sadly you cannot infer template arguments from function return types.)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2441850399540300710.post-74149733706560960812004-03-30T07:07:00.000-08:002004-03-30T07:07:00.000-08:00I read the ADO.NET and XML v2.0 book, but it eithe...I read the ADO.NET and XML v2.0 book, but it either wasn't in there or I missed it. Anyway, this is very interesting.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2441850399540300710.post-34397467014385127532004-03-30T06:34:00.000-08:002004-03-30T06:34:00.000-08:00A great idea. From what I can see, Whidbey support...A great idea. From what I can see, Whidbey supports this scenario in a very few lines of code...just not in one line of code.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2441850399540300710.post-12420234969748227682004-03-30T05:41:00.000-08:002004-03-30T05:41:00.000-08:00Ok, that's pretty cool, and I could use it rig...Ok, that's pretty cool, and I could use it right now.<br /><br />Something else that would be cool is a way to mate XPath expressions with XmlSerializer. So,<br /><br /> Book book = (Book)(xpathNav.SelectAsObject("/root/book", typeof(Book)));<br /><br />What do you think?Anonymousnoreply@blogger.com