I am trying to read the data from XML File. In this elements are prefixed with ‘app’ and ‘gml’ text. because of these prefixes I am unable to read the data. For this I am trying to add namespace by using XMLNamespaceManager but not getting.
Edit:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(new StringReader(strResult));
NameTable nt = new NameTable();
XmlNamespaceManager prefix = new XmlNamespaceManager(nt);
string nmspc = xmlDoc.DocumentElement.NamespaceURI;
prefix.AddNamespace("app:",xmlDoc.DocumentElement.NamespaceURI);
prefix.PushScope();
Here the strResult contains XML Data
Something like:
Note that the namespace aliases are merely conveniences, and don’t have to match between the document and the namespace-manager – but it is probably easier if they do.