Details
Description
Class org.jaxen.jdom.DocumentNavigator: In function Object getDocumentNode(Object contextNode), if contextNode is an instance of Text, ProcessingInstruction or any other class different from Element or Document it throws a ClassCastException. I think it should check if contextNode is any of the possible classes (Document, XPathNamespace, Element, Attribute, Text, ProcessingInstruction or Comment).
Can you provide a test case that demonstrates the bug in the ussual way; i.e. by invoking selectNodes on a JDOM document and without directly calling this method? My initial tests to contrive such a case failed. It may be that Jaxen never passes the wrong type of object to this method.