XPath,XML, and .NET Framework

Hi

What is the relevance of XPath queries especially since .NET Framework provides built in support for XML and we can do whatever we want to with XML without ever needing XPath or anything. While this suffices for practical development, i am not sure whether i m true or not. But i would really like to be enlightened about the relevance of XPath, XQuery, XForms,Xpointers in the current scenario before I dig deep into these technologies. is it going to be worth the effort. Any suggestions are really needed. Thanks in advance.

Thanks and regards
Nancy

[564 byte] By [SureshBeniwal] at [2008-2-15]
# 1
.NET provides built-in support for XPath 1.0. It's a main method of querying XML in .NET. Bits of XQuery are supported in SQL Server 2005 only and it's a main method of querying XML typed columns. XPointer is not supported by .NET, but you can have it with Mvp.Xml library [1] which supports XInclude and XPointer.
XForms is still ignored in .NET land.

[1] http://mvp-xml.sf.net

OlegTkachenko at 2007-9-9 > top of Msdn Tech,.NET Development,XML and the .NET Framework...
# 2
When you load XML into the .NET object System.Xml.XmlDocument, XPath is a convenient way to query the nodes in this XML document object model. See the XmlNode.SelectNodes() method documentation. Perhaps what you mean by "built in support" is the XmlSerializer that serializes XML into C# or VB classes. Yes you can do whatever C# code you want on your classes, but C# still doesn't have anything quite as powerful as XPath, so you have to write a bunch of for-each loops over your objects and so on. So in .NET there are two models. The loosely-typed model represented by System.Xml.XmlDocument and the strongly typed model represented by your own classes populated by the XmlSerializer. You get to decide which model fits your requirements the best.

As for XQuery - this is something that belongs in the Database world, and is supported inside SQL Server 2005 over the new XML datatype.

An rough comparison of XForms versus Microsoft's InfoPath product is available up on http://www.xml.com/pub/a/2003/10/29/infopath.html. More information on infopath is available at http://office.microsoft.com/en-us/FX010857921033.aspx.

ChrisLovett at 2007-9-9 > top of Msdn Tech,.NET Development,XML and the .NET Framework...

.NET Development

Site Classified