Advertisement
Guest User

NullPointerException in Laser library

a guest
Mar 5th, 2014
166
0
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>"))
  6.  
  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)))
  13.  
  14. ; What's wrong with my API usage?
  15. webapp.layout=> (l/document html (l/id= "mylist") mess-with-ul)
  16. NullPointerException   clojure.zip/branch? (zip.clj:73)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement