title: What is the difference between using "../" and "parent" in an XPath query?
body: <p>What is the difference here between using "../" and "parent" to get the parent node in an XPath query.  I had thought they were synonymous.</p>
  
  <p>Given the following two XPath queries is there really any difference between these two?</p>
  
  <pre><code>//Node/id[@type='image']/id[@attr1='myVal']/../../*
  
  //Node/id[@type='image']/id[@attr1='myVal']/parent::*/parent::*
  </code></pre>
  
  <p>I am working on a C#/ASP.net application and using the first XPath query I get back actually the first sibling previous to the Node element.  What I am looking for is the Node element itself and all its children.  The second XPath query will give me my expected result. </p>
  
  <p>I am wondering why there is a difference here.</p>