What is the XDocument equivalent of XMLDocument.DocumentElement.NamespaceURI

StackOverflow https://stackoverflow.com/questions/23529050

  •  17-07-2023
  •  | 
  •  

Question

I am trying to use XDocument for its linq methods.

I have seen doc.Root.GetNamespaceOfPrefix( "i" ) where doc is the XDocument and "i" is the namespace, but, with XmlDocument, I don't have to know about "i".

Était-ce utile?

La solution

I think you are looking for XElement.GetDefaultNamespace Method

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top