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.
Comments
Mihai Campean replied ago:
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!
Voters For This Link (2)
Voters Against This Link (0)