/** * Report a static error in the stylesheet * * @param message the error message */ public void compileError(String message) { compileError(message, "XTSE0010"); }
/** * Report a static error in the stylesheet * * @param message the error message */ public void compileError(String message) { compileError(message, "XTSE0010"); }
/** * Convenience method to report the absence of a mandatory attribute * @param attribute the name of the attribute whose absence is to be reported * @throws XPathException if the attribute is missing */ public void reportAbsence(String attribute) throws XPathException { compileError("Element must have a \"" + attribute + "\" attribute", "XTSE0010"); }
/** * Convenience method to report the absence of a mandatory attribute * @param attribute the name of the attribute whose absence is to be reported * @throws XPathException if the attribute is missing */ public void reportAbsence(String attribute) throws XPathException { compileError("Element must have a \"" + attribute + "\" attribute", "XTSE0010"); }
/** * Convenience method to report the absence of a mandatory attribute * * @param attribute the name of the attribute whose absence is to be reported */ public void reportAbsence(String attribute) { compileError("Element must have an " + Err.wrap(attribute, Err.ATTRIBUTE) + " attribute", "XTSE0010"); }
/** * Process the attribute list for the element. This is a wrapper method that calls * prepareAttributes (provided in the subclass) and traps any exceptions */ protected final void processAttributes() { try { prepareAttributes(); } catch (XPathException err) { compileError(err); } }
/** * Convenience method to check that the stylesheet element is at the top level * @param errorCode the error to throw if it is not at the top level; defaults to XTSE0010 * if the value is null * @throws XPathException if not at top level */ public void checkTopLevel(String errorCode) throws XPathException { if (!(getParent() instanceof XSLStylesheet)) { compileError("Element must be used only at top level of stylesheet", (errorCode==null ? "XTSE0010" : errorCode)); } }
protected void undeclaredNamespaceError(String prefix, String errorCode) throws XPathException { if (errorCode == null) { errorCode = "XTSE0280"; } compileError("Undeclared namespace prefix " + Err.wrap(prefix), errorCode); }
/** * Process the attribute list for the element. This is a wrapper method that calls * prepareAttributes (provided in the subclass) and traps any exceptions */ protected final void processAttributes() { try { prepareAttributes(); } catch (XPathException err) { compileError(err); } }
/** * Compile time error, specifying an error code * * @param message the error message * @param errorCode the error code. May be null if not known or not defined */ public void compileError(String message, String errorCode) { compileError(new XPathException(message, errorCode, this)); }
/** * Convenience method to check that the stylesheet element is empty */ public void checkEmpty() { if (hasChildNodes()) { compileError("Element must be empty", "XTSE0260"); } }
/** * Convenience method to check that the stylesheet element is empty * * @throws XPathException if it is not empty */ public void checkEmpty() throws XPathException { if (hasChildNodes()) { compileError("Element must be empty", "XTSE0260"); } }
/** * Compile time error, specifying an error code * * @param message the error message * @param errorCode the error code. May be null if not known or not defined */ public void compileError(String message, String errorCode) { compileError(new XPathException(message, errorCode, this)); }
/** * Convenience method to check that the stylesheet element is empty */ public void checkEmpty() { if (hasChildNodes()) { compileError("Element must be empty", "XTSE0260"); } }
/** * Report a static error in the stylesheet * @param message the error message * @throws XPathException always, after reporting the error to the ErrorListener */ protected void compileError(String message) throws XPathException { XPathException tce = new XPathException(message); tce.setLocator(this); compileError(tce); }
/** * Report an error with diagnostic information * * @param error contains information about the error */ protected void compileError(XPathException error) { error.setIsStaticError(true); getRootElement().compileError(error); }
/** * Report an error with diagnostic information * * @param error contains information about the error */ protected void compileError(XPathException error) { error.setIsStaticError(true); getRootElement().compileError(error); }
/** * Report a static error in the stylesheet * @param message the error message * @throws XPathException always, after reporting the error to the ErrorListener */ protected void compileError(String message) throws XPathException { XPathException tce = new XPathException(message); tce.setLocator(this); compileError(tce); }
/** * Compile time error, specifying an error code * * @param message the error message * @param errorCode the error code. May be null if not known or not defined */ public void compileError(String message, StructuredQName errorCode) { XPathException tce = new XPathException(message); tce.setErrorCodeQName(errorCode); tce.setLocator(this); compileError(tce); }
private void notStreamable(StyleElement rule, String message) throws XPathException { boolean fallback = getConfiguration().getBooleanProperty(Feature.STREAMING_FALLBACK); if (fallback) { message += ". Falling back to non-streaming implementation"; rule.compileWarning(message, "XTSE3430"); rule.getCompilation().setFallbackToNonStreaming(true); } else { rule.compileError(message, "XTSE3430"); } }