Skip to content

Instantly share code, notes, and snippets.

@lmatt-bit
Created August 16, 2017 08:49
Show Gist options
  • Save lmatt-bit/898952d65e92f07dac1610353a8f5eb9 to your computer and use it in GitHub Desktop.
Save lmatt-bit/898952d65e92f07dac1610353a8f5eb9 to your computer and use it in GitHub Desktop.
xml with namespace; .net
var path = @"C:\Users\lmatt\Desktop\MTTest\MT Test 02.docx.xlf";
XmlNamespaceManager namespaceManager = new XmlNamespaceManager(new NameTable());
namespaceManager.AddNamespace("prefix", "urn:oasis:names:tc:xliff:document:1.2");
var xelement = XElement.Load(path);
xelement.XPathSelectElements("//prefix:seg-source/prefix:mrk", namespaceManager).Select(e => e.Value).Dump();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment