[2005]
I have been asked to amend someone elses code and am not sure about it.
Can someone explain this this to me :
xmlSearchDoc contains the following :Code:Dim xmlSearchDoc As New XmlDocument() xmlSearchDoc.LoadXml(sb.ToString()) Dim nameMan As New XmlNamespaceManager(xSearchDoc.NameTable) nameMan.AddNamespace("nameMan", xmlSearchDoc.DocumentElement.NamespaceURI) XmlNodeList nlResults = xmlSearchDoc.SelectNodes(@"//namesMan:LocationName", nameMan)
Firstly, I dont understand the namespacemanager bit. Why add a namespacemanager ?Code:<Organisations> <Organisation xmlns="http://www.test.com/LocationRecord"> <GUID>{0378BE2E-D3A5-4905-AA80-4C3138B6726E}</GUID> <LocationName>Location Test</LocationName> </Organisation> </Organisations>
And why is it that I return nothing when I do my "XmlNodeList nlResults = xmlSearchDoc.SelectNodes(@"//namesMan:LocationName", nameMan)"





Reply With Quote