/** * Inform TrAX error listener of a warning */ private void postWarningToListener(String message) { try { _errorListener.warning(new TransformerException(message)); } catch (TransformerException e) { // ignored - transformation cannot be continued } }
public void displayMessage(String msg) { if(_errorListener == null) { System.err.println(msg); } else { try { _errorListener.warning(new TransformerException(msg)); } catch (TransformerException e) { // ignored } } } }
/** * Receive notification of a XSLT processing warning. * * @param e The warning information encoded as an exception. * * @throws org.xml.sax.SAXException that wraps a * {@link javax.xml.transform.TransformerException} if the current * {@link javax.xml.transform.ErrorListener#warning} * method chooses to flag this condition as an error. */ public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
/** * Receive notification of a XSLT processing warning. * * @param e The warning information encoded as an exception. * * @throws org.xml.sax.SAXException that wraps a * {@link javax.xml.transform.TransformerException} if the current * {@link javax.xml.transform.ErrorListener#warning} * method chooses to flag this condition as an error. */ public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
/** * Warn the user of a problem. * * @param styleNode Stylesheet node * @param sourceNode Source tree node * @param msg Message text to issue * @param args Arguments to pass to the message * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws TransformerException * @xsl.usage internal */ public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object args[]) throws TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.warning(new TransformerException(formattedMsg, srcLctr)); else System.out.println(formattedMsg); }
/** * Warn the user of a problem. * * @param styleNode Stylesheet node * @param sourceNode Source tree node * @param msg Message text to issue * @param args Arguments to pass to the message * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws TransformerException * @xsl.usage internal */ public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object args[]) throws TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.warning(new TransformerException(formattedMsg, srcLctr)); else System.out.println(formattedMsg); }
/** * Warn the user of a problem. * This is public for access by extensions. * * @param msg The message text to issue * @param terminate Flag indicating whether to terminate this process * @throws XSLProcessorException thrown if the active ProblemListener and XPathContext decide * the error condition is severe enough to halt processing. * * @throws TransformerException */ public void message(SourceLocator srcLctr, String msg, boolean terminate) throws TransformerException { ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) { errHandler.warning(new TransformerException(msg, srcLctr)); } else { if (terminate) throw new TransformerException(msg, srcLctr); else System.out.println(msg); } }
/** * Warn the user of a problem. * * @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. */ void warn(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = this.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, m_sourceLocator)); } else { // Should never happen. System.err.println(fmsg); } }
/** * Warn the user of a problem. * * @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. */ void warn(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = this.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, m_sourceLocator)); } else { // Should never happen. System.err.println(fmsg); } }
/** * Warn the user of a problem. * * @param xctxt The XPath runtime state. * @param msg Warning message key * @param args Arguments to be used in the warning 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 */ public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.warning(spe); else System.out.println(formattedMsg); }
/** * This is an internal version of Set Error that is called withen * XConnection where there is no SQLDocument created yet. As in the * Connect statement or creation of the ConnectionPool. */ public void setError(Exception excp,ExpressionContext expr) { try { ErrorListener listen = expr.getErrorListener(); if ( listen != null && excp != null ) { listen.warning( new TransformerException(excp.toString(), expr.getXPathContext().getSAXLocator(), excp)); } } catch(Exception e) {} }
/** * Warn the user of a problem. * * @param xctxt The XPath runtime state. * @param msg Warning message key * @param args Arguments to be used in the warning 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 */ public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.warning(spe); else System.out.println(formattedMsg); }
/** * Warn the user of an problem. * * @param msg An key into the {@link org.apache.xalan.res.XSLTErrorResources} * table, that is one of the WG_ prefixed definitions. * @param args An array of arguments for the given warning. * * @throws org.xml.sax.SAXException that wraps a * {@link javax.xml.transform.TransformerException} if the current * {@link javax.xml.transform.ErrorListener#warning} * method chooses to flag this condition as an error. * @xsl.usage internal */ public void warn(String msg, Object args[]) throws org.xml.sax.SAXException { String formattedMsg = XSLMessages.createWarning(msg, args); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { if (null != handler) handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
/** * Warn the user of a problem. * * @param xctxt The XPath runtime state. * @param msg Warning message key * @param args Arguments to be used in warning 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 */ public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); errHandler.warning(new TransformerException(formattedMsg, (SAXSourceLocator)xctxt.getSAXLocator())); }
/** * Pass warning messages from the compiler to the error listener */ private void passWarningsToListener(Vector messages) throws TransformerException { if (_errorListener == null || messages == null) { return; } // Pass messages to listener, one by one final int count = messages.size(); for (int pos = 0; pos < count; pos++) { ErrorMsg msg = (ErrorMsg)messages.elementAt(pos); // Workaround for the TCK failure ErrorListener.errorTests.error001. if (msg.isWarningError()) _errorListener.error( new TransformerConfigurationException(msg.toString())); else _errorListener.warning( new TransformerConfigurationException(msg.toString())); } }
/** * Warn the user of a problem. * * @param xctxt The XPath runtime state. * @param msg Warning message key * @param args Arguments to be used in warning 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 */ public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); errHandler.warning(new TransformerException(formattedMsg, (SAXSourceLocator)xctxt.getSAXLocator())); }
/** * Warn the user of an problem. * * @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. */ public void warn(String msg, Object[] args) throws TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != m_errorHandler) { m_errorHandler.warning(new TransformerException(fmsg, m_locator)); } else { System.out.println(fmsg +"; file "+m_locator.getSystemId() +"; line "+m_locator.getLineNumber() +"; column "+m_locator.getColumnNumber()); } }
/** * Warn the user of an problem. * * @param xctxt The XPath runtime context. * @param msg An error msgkey that corresponds to one of the conststants 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. * * @throws javax.xml.transform.TransformerException */ public void warn(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); // TO DO: Need to get stylesheet Locator from here. eh.warning(new TransformerException(fmsg, xctxt.getSAXLocator())); } }
/** * Warn the user of an problem. * * @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. */ public void warn( XPathContext xctxt, int sourceNode, String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = xctxt.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator())); } }
/** * Warn the user of an problem. * * @param xctxt The XPath runtime context. * @param msg An error msgkey that corresponds to one of the conststants 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. * * @throws javax.xml.transform.TransformerException */ public void warn(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); // TO DO: Need to get stylesheet Locator from here. eh.warning(new TransformerException(fmsg, xctxt.getSAXLocator())); } }