title: Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function
body: <p>I have following XML </p>
  
  <pre><code>&lt;DataTable xmlns = "http://schemas.datacontract.org/2004/07/System.Data"&gt;
      &lt;xs:schema
          id = "NewDataSet"
          xmlns = ""
          xmlns:xs = "http://www.w3.org/2001/XMLSchema"
          xmlns:msdata = "urn:schemas-microsoft-com:xml-msdata"&gt;
          &lt;xs:element
              name = "NewDataSet"
              msdata:IsDataSet = "true"
              msdata:MainDataTable = "Table"
              msdata:UseCurrentLocale = "true"&gt;
              &lt;xs:complexType&gt;
                  &lt;xs:choice minOccurs = "0" maxOccurs = "unbounded"&gt;
                      &lt;xs:element name = "Table"&gt;
                          &lt;xs:complexType&gt;
                              &lt;xs:sequence&gt;
                                  &lt;xs:element
                                      name = "Id"
                                      type = "xs:int"
                                      minOccurs = "0"/&gt;
                                  &lt;xs:element
                                      name = "Industry"
                                      type = "xs:string"
                                      minOccurs = "0"/&gt;
                                  &lt;xs:element
                                      name = "ParentId"
                                      type = "xs:int"
                                      minOccurs = "0"/&gt;
                              &lt;/xs:sequence&gt;
                          &lt;/xs:complexType&gt;
                      &lt;/xs:element&gt;
                  &lt;/xs:choice&gt;
              &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
      &lt;/xs:schema&gt;
      &lt;diffgr:diffgram xmlns:msdata = "urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr = "urn:schemas-microsoft-com:xml-diffgram-v1"&gt;
          &lt;NewDataSet xmlns = ""&gt;
              &lt;Table diffgr:id = "Table1" msdata:rowOrder = "0"&gt;
                  &lt;Id&gt;1592&lt;/Id&gt;
                  &lt;Industry&gt;Fortune 100&lt;/Industry&gt;
                  &lt;ParentId&gt;1810&lt;/ParentId&gt;
              &lt;/Table&gt;
              &lt;Table diffgr:id = "Table2" msdata:rowOrder = "1"&gt;
                  &lt;Id&gt;1601&lt;/Id&gt;
                  &lt;Industry&gt;Oil &amp;amp; Gas Operations&lt;/Industry&gt;
                  &lt;ParentId&gt;0&lt;/ParentId&gt;
              &lt;/Table&gt;
               &lt;/NewDataSet&gt;
      &lt;/diffgr:diffgram&gt;
  &lt;/DataTable&gt;
  </code></pre>
  
  <p>I need nodes with parentID = 0</p>
  
  <p>but when I use following code:</p>
  
  <pre><code> Dim parentNodes As XmlNodeList = xml_node.SelectNodes("/DataTable/diffgr:diffgram/NewDataSet/Table[ParentId=0]")
  </code></pre>
  
  <p>I get this error</p>
  
  <p>Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.</p>
  
  <p>Please suggest solution</p>