title: How should I debug a Nokogiri Null Pointer exception?
body: <p>A contractor created a fairly complex XSLT for a client of mine.  It works great in various transform testing tools, using real data from our application.   But Nokogiri barfs on it during transform.  With $VERBOSE and $DEBUG set, I still get the uninformative: </p>
  
  <pre><code>Exception `RuntimeError' at nokogiri/XsltStylesheet.java:231 - java.lang.NullPointerException
  </code></pre>
  
  <p>So I thought I would create a custom Nokogiri Gem with some debug code in it, using this in my Gemfile:</p>
  
  <pre><code>gem 'nokogiri', :git =&gt; 'ssh://git@192.168.185.65:7999/bssc/nokogiri.git'
  </code></pre>
  
  <p>That doesn't work because of a versioning issue I don't understand how to resolve:</p>
  
  <pre><code>Source does not contain any versions of 'nokogiri java'
  </code></pre>
  
  <p>So at this point I thought I'd reach out and ask the community for a better idea.  I'm sure it's something in the stylesheet that Nokogiri is not happy with, but it is difficult to locate because of the complexity of the XSLT.  </p>
  
  <p>Suggestions?   </p>