What is the XDocument equivalent of XMLDocument.DocumentElement.NamespaceURI

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

  •  17-07-2023
  •  | 
  •  

Domanda

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".

È stato utile?

Soluzione

I think you are looking for XElement.GetDefaultNamespace Method

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top