code: public void error(
            XPathContext xctxt, int sourceNode, String msg, Object[] args)
              throws javax.xml.transform.TransformerException
    {
  
      String fmsg = XSLMessages.createXPATHMessage(msg, args);
      ErrorListener ehandler = xctxt.getErrorListener();
  
      if (null != ehandler)
      {
        ehandler.fatalError(new TransformerException(fmsg,
                                (SAXSourceLocator)xctxt.getSAXLocator()));
      }
      else
      {
        SourceLocator slocator = xctxt.getSAXLocator();
        System.out.println(fmsg + "; file " + slocator.getSystemId()
                           + "; line " + slocator.getLineNumber() + "; column "
                           + slocator.getColumnNumber());
      }
    }
docs: Tell the user of an error, and probably throw an
  exception.
  
  @param xctxt The XPath runtime context.
  @param sourceNode Not used.
  @param msg An error msgkey that corresponds to one of the constants found
  in {@link org.apache.xpath.res.XPATHErrorResources}, which is
  a key for a format string.
  @param args An array of arguments represented in the format string, which
  may be null.
  
  @throws TransformerException if the current ErrorListoner determines to
  throw an exception.