Friday, June 18, 2010

Calculate XML Element Depth

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

No comments:

Post a Comment