title: Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function
body: <p>I am trying to call <code>SelectNode</code> from <code>XmlDocument</code> class and trouble due to this error:</p>
  
  <blockquote>
    <p>Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>   public void Add(ref XmlDocument xmlFormat, String strName)
     {
          XmlDocument dom;
          XSLTemplate xsl = null;
          String strPath = "";
          XmlNodeList nl;
          XmlAttribute na;
          int n;
  
          nl = (XmlNodeList)xmlFormat.SelectNodes("//xsl:import/@href",nsm);
      }
  </code></pre>
  
  <p>and xsl:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:import href="stylesheets/r_adresetiket.xsl" /&gt;
      &lt;xsl:template match="/"&gt;
          &lt;xsl:call-template name="retouradres"&gt;
              &lt;xsl:with-param name="_retouradres" select="data/adresetiket/_retouradres" /&gt;
              &lt;xsl:with-param name="minofdir" select="data/adresetiket/afzendgegevens/afzendgegevens" /&gt;
              &lt;xsl:with-param name="checked" select="data/adresetiket/LB" /&gt;
          &lt;/xsl:call-template&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>