Skip to content

Instantly share code, notes, and snippets.

@automatonic
Created January 13, 2015 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save automatonic/435df08ad7e2e3a2758e to your computer and use it in GitHub Desktop.
Save automatonic/435df08ad7e2e3a2758e to your computer and use it in GitHub Desktop.
Get XDocument descendants when an xmlns is in play
XNamespace ns = "http://somedomain.com/some/path";
//if file.xml root element has xmlns="http://somedomain.com/some/path"
var descendants = XDocument.Load("file.xml").Descendants(ns + "Child");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment