«« Next » « Previous
«« Next » « Previous

Link Details

Link 70461 thumbnail
User 273459 avatar

By jaredstehler
via abstractbits.blogspot.com
Submitted: Mar 12 2008 / 08:32

If you use Node.selectSingleNode on a Node/Element which is not the root element in a document, expecting that the XPath expression will consider the current node as root, you are mistaken and will be introducing potentially serious bugs into your app! I've seen this used incorrectly at a couple of different companies now; good to know to avoid an 8-hour debug session.
  • 2
  • 0
  • 321
  • 38

Comments

Add your comment
User 180410 avatar

Mihai Campean replied ago:

0 votes Vote down Vote up Reply

This is dead on! I encountered the same issue with dom4j and I got so pissed of because I didn't know how to use the XPath expressions to select some info from certain nodes. Thanks Jared!

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)



Voters Against This Link (0)