SelectNodes only works one level when xmlns is present
SelectNodes only works for one level when xmnls is present. My xml file has a xmlns declaration and SelectNodes only works for one level.
My code:
XmlNamespaceManager namespaceManager = new
XmlNamespaceManager(xmlDocument.NameTable);
namespaceManager.AddNamespace("pf","urn:astm-org:CCR" );
nodeList = xmlDocument.SelectNodes("//pf:CCRDocumentObjectID", namespaceManager);
This will return one node.
nodeList = xmlDocument.SelectNodes("//ContinuityOfCareRecord/@pf:CCRDocumentObjectID", namespaceManager);
But the above statement will not return any node.
The following is fragment of my xml file.
<?xml version="1.0" encoding="UTF-8"?>
<ContinuityOfCareRecord xmlns="urn:astm-org:CCR" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:astm-org:CCR CCR1.0.xsd">
<CCRDocumentObjectID>DW2005-05-31T22:34:32Z</CCRDocumentObjectID>
</ContinuityOfCareRecord>
Any help will be appreciated.

