A few weeks ago during the follow up to the WinFX review of the System.Xml namespace of the .NET Framework it was pointed out that our team hadn't provided guidelines for exposing and manipulating XML data in applications. At first, I thought the person who brought this up was mistaken but after a cursory search I realized the closest thing that comes to such a set of guidelines is Don Box's MSDN TV episode entitled Passing XML Data Inside the CLR. As good as Don's discussion is, a video stream isn't as accessible as a written article. In tandem with coming up with some of the guidelines for utilizing XML in the .NET Framework for internal purposes I'll put together an article based on Don's MSDN TV episode with an eye towards the next version of the .NET Framework.

If you watched Don's talk and had any questions about it or require any clarifications respond below so I can clarify them in the article I plan to write.


 

Tuesday, 10 February 2004 18:55:10 (GMT Standard Time, UTC+00:00)
I watched the video and have experimented with using XPathNavigator as the defacto XML representation inside a web app. The only "issue" I ran into was when caching the Xpathnavigator in the ASP.NET Cache. Once I iterated through the Navigator at least part way, subsequent acceses to the same navigator return you to the same node where you left off. Of course, this is the way it's supposed to work, but when you're caching the XML it can seem sounter-intuitive not to be positioned at the root node. My solution was to simply cache the XPathDocument and for the data access method to return a navigator by calling CreateNavigator() on the document. The only thing I'd really like to see on XPathDocument is a handy Save() method a la XmlDocument.
Christian Romney
Comments are closed.