class JdbcXPathParameter extends NullableParameter {

  @Override
  public Object applyInputParam(AdaptrisMessage msg) throws JdbcParameterException {
    this.checkXPath();
    NamespaceContext ctx = SimpleNamespaceContext.create(namespaceContext, msg);
    try {
      DocumentBuilderFactoryBuilder builder = documentFactoryBuilder();
      XPath xpathToUse = newXPathInstance(builder, ctx);
      Document doc = XmlHelper.createDocument(msg, builder);
      String textItem = xpathToUse.selectSingleTextItem(doc, msg.resolve(getXpath()));
      return normalize(textItem);
    }
    catch (Exception ex) {
      throw new JdbcParameterException(ex);
    }
  }

}