title: validate an xpath expression in Java
body: <p>Given an user input string, how can I tell whether it is a 
  valid Xpath expression or not in Java. Just curious, since I cannot 
  find a way to do it using javax.xml.xpath library. Thanks.</p>