Resolve namespaces in XDocument c?

You need to tell the parser how to reference the namespace: XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlElem.OwnerDocument. NameTable); nsmgr. AddNamespace("apd", "PATH_TO_NAMESPACE_DOC") That should do it.

You need to tell the parser how to reference the namespace: XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlElem.OwnerDocument. NameTable); nsmgr. AddNamespace("apd", "PATH_TO_NAMESPACE_DOC"); That should do it.

– Shai Cohen Nov 16 at 17:01 I wonder if is there any way to resolve name spaces in XDocumet:XDocument doc = new XDocument(); doc = XDocument. Load(filename); – Hashem Nov 16 at 17:08 Not that I know of.Is there a problem using XmlNamespaceManager? – Shai Cohen Nov 16 at 17:09 Unfortunately I have got more than 40 classes and in all of them I used XDocument, xml linq, not XML Document – Hashem Nov 16 at 17:10.

You have to use the namespace that matches the one used in your XML, with Linq to XML you can use XNamespace for that i.e. : XDocument doc = XDocument. Load("test.

Xml"); XNamespace apd = "govtalk.gov.uk/people/AddressAndPersonal...; var first Descendants(apd + "Line").First().

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions