code: public void error(XPathContext xctxt, String msg, Object args[])
            throws javax.xml.transform.TransformerException
    {
  
      String formattedMsg = XSLMessages.createMessage(msg, args);
      ErrorListener errHandler = xctxt.getErrorListener();
      TransformerException spe = new TransformerException(formattedMsg,
                                (SourceLocator)xctxt.getSAXLocator());
  
      if (null != errHandler)
        errHandler.error(spe);
      else
        System.out.println(formattedMsg);
    }
docs: Tell the user of an error, and probably throw an
  exception.
  
  @param xctxt The XPath runtime state.
  @param msg The error message key
  @param args Arguments to be used in the error message
  @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide
  the error condition is severe enough to halt processing.
  
  @throws javax.xml.transform.TransformerException