NullPointerException in Laser library

a guest Mar 5th, 2014 103 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; <ul id="mylist">
  2. ;  <li id="item1"><a href="link1">1</a></li>
  3. ; </ul>
  4. (def html
  5.   (l/parse "<ul id=\"mylist\"><li id=\"item1\"><a href=\"link1\">1</a></li></ul>"))
  7. ; Transformer function for the <ul>. This would do real work in the actual
  8. ; app, but here we just want to see if the "select" successfully located the
  9. ; first item in the list.
  10. (defn mess-with-ul [ul]
  11.   (let [list-item (l/select ul (l/id= "item1"))]
  12.     (println list-item)))
  14. ; What's wrong with my API usage?
  15. webapp.layout=> (l/document html (l/id= "mylist") mess-with-ul)
  16. NullPointerException (zip.clj:73)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand