Dare posted a couple of good comments tomy last post.
I think that the fact that the MSDN implementation of ObjectXPathNavigator can't handlenested instances of IXPathNavigator effectively means that it can't handle nestedcomplex types (at least nested complex types that are "interesting"). If you go downthe ObjectXPathNavigator route, any type that could be represented as a root-levelentity in an XML document will have a corresponding first-order object representationthat implements IXPathNavigable. Subordinate complex elements contained within thatroot element will have a second-order object representation that does not implementIXPathNavigable in order to get around the inability of the ObjectXPathNavigator totraverse a type tree that contains instances of IXPathNavigable.
This will create problems when you create first-order types that are composistionsof other first-order types, because the types you are composing will themselves beIXPathNavigable and the ObjectXPathNavigator implementation on MSDN can't handle that.For example, I could have first-order types Job and Company thatare both IXPathNavigable. However, I can't create a first-order Employee thatcontains both a Job and Company andhave it work with the ObjectXPathNavigator out of the box.
This is all academic and not really worth arguing about, because it could be fixedby just making the ObjectXPathNavigator class know how to deal with nested first-orderobjects and just be done with it.
I'm going to punt on the extensibility question right now, because I'm at an internetcafe waiting for some friends and I don't have access to Visual Studio. As such, Ican't play with any code. But Dare's point about the XmlSerializer's support for extensibilityis valid.
However, I think there is one clear place that strongly-typed DOM's win over XPathNavigators:support for mutation. ObjectXPathNavigator forces me to make a choice -- either Ican alter my data by going through the object representation, or I can query thatdata by getting an ObjectXPathNavigator. Once I get that XPathNavigator instance,I'm stuck in a read-only access pattern. Using ObjectXPathNavigator, I could findall Employees named "Steve" that were in my object graph using XPath, but I can'tupdate the salaries of those employees because XPathNodeIterator is essentially read-only.At least with the DOM model, I can do some sort of persistent transformation on thedata that matched my XPath -- which usually a requirement in real-world applicationscenarios.
I'm really looking forward to that upcoming Extreme XML column.
