title: To fetch the attributes from the NodeList of XmlDocument?
body: <p>I have part of XmlDocument Example.xml as given below:</p>
  
  <pre><code>&lt;rapaine dotoc="palin" domap="rattmin"&gt;
    &lt;derif meet="local" /&gt;
    &lt;derif meet="intro" /&gt;
  .
  .
  .
  &lt;/rapaine&gt;
  </code></pre>
  
  <p>Here i am creating a Nodelist and fetching the element raplin to get its attributes.  </p>
  
  <p>Now i want to make sure that whether the attributes 'dotoc' and 'domap' are the attributes of rapaine with respective values which are always fixed.Then only i can access the childNodes 'deriff' with its attribute 'meet'. here the value only changes.<br>
  i have written a part of code there are no compile errors but on debugging i found that its not going inside the for loop to check its attributes and child nodes.</p>
  
  <pre><code>XmlNodeList listOfSpineRootNodes = opfXmlDoc.GetElementsByTagName("rapine");
  for (int x = 0; x &lt; listOfSpineRootNodes.Count; x++)
    {
      XmlAttributeCollection spineAttributes = listOfSpineRootNodes[x].Attributes;
      string id = spineAttributes[0].Value;
      if (spineAttributes != null)
      {
        XmlNode attrToc = spineAttributes.GetNamedItem("dotoc");
        XmlNode attrPageMap = spineAttributes.GetNamedItem("domap");
        if (attrToc.Value == "palin" &amp;&amp; attrPageMap.Value == "rattmine")
        {
          if (listOfSpineRootNodes != null)
          {
            foreach (XmlNode spineNodeRoot in listOfSpineRootNodes)
            {
              XmlNodeList listOfSpineItemNodes = spineNodeRoot.ChildNodes;
              if (listOfSpineItemNodes != null)
              {
                foreach (XmlNode spineItemNode in listOfSpineItemNodes)
                {
                  if (spineItemNode.NodeType == XmlNodeType.Element
                    &amp;&amp; spineItemNode.Name == "derif")
                  {
                    XmlAttributeCollection spineItemAttributes = spineItemNode.Attributes;
  
                    if (spineItemAttributes != null)
                    {
                      XmlNode attrIdRef = spineItemAttributes.GetNamedItem("meet");
                      if (attrIdRef != null)
                      {
                        spineListOfSmilFiles.Add(attrIdRef.Value);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
  </code></pre>
  
  <p>Can you please tell me where i am going wrong..
  Thanks....</p>