I am not sure why this is not working.
I have an XmlNode in a known format. It:
<[setting-name]>
<dictionary>
<[block-of-xml-to-process]/>
<[block-of-xml-to-process]/>
<[block-of-xml-to-process]/>
</dictionary>
</[setting-name]>
I have a link to node in a variable called pattern . I want an iterable set of nodes, each of which is represented [block-of-xml-to-process] above. The name and structure of the blocks are currently unknown. The name [Setting-name] is known.
It seems pretty simple. I can imagine half a dozen XPATH expressions that should point to blocks. I tried:
XmlNodeList kvpsList = pattern.SelectNodes(String.Format(@"/{0}/dictionary/*", _CollectionName));
XmlNodeList kvpsList = pattern.SelectNodes(String.Format(@"{0}/dictionary/*", _CollectionName));
XmlNodeList kvpsList = pattern.SelectNodes(@"//dictionary/*");
XmlNodeList kvpsList = pattern.SelectNodes(@"//dictionary");
But apparently I lack a basic understanding of XPATH or some special .SelectNodes trick, because none of them work in sequence.
What am I doing wrong?