I am having an app that gets an xml stream continuosly and then use it to process some information. So far i had only one name space for all the streams and i did it easily as
doc = new XPathDocument(ds + "/probe");
navigator = doc.CreateNavigator();
ns = new XmlNamespaceManager(navigator.NameTable);
ns.AddNamespace("m", "urn:namsp.org:namSpDev:1.1");
nodes = navigator.Select("//m:DataItem", ns);
while (nodes.MoveNext())
{
node = nodes.Current;
}
But now i have a problem. THere is another stream that has the namespace
"urn:namsp.org:namSpDev:1.2"
So in my application i have to check the stream and see which namespace it is and then only i can add the app name space using
ns.AddNamespace("m", "urn:namsp.org:namSpDev:1.1");
How should i do this?
I tried converting the doc.toString() and used .contains() to check if any one of this passes but it doesnt work.