Showing posts with label linq2xml. Show all posts
Showing posts with label linq2xml. Show all posts

Friday, June 18, 2010

Calculate XML Element Depth

In XPath (from the excellent D.Pawson site):
In LINQ:
  • int depth = element.Ancestors().Count();

Friday, February 05, 2010

Learning More About Linq To Xml

Being armpit-deep in the slightly clearer .NET waters of MVC 2 RC 2 has lead me to getting further into the (shark infested?) LINQ deeps. Therefore, when I went looking for some good "how to sort XML using LINQ" on google, I came across this: