/** * External functions that cannot be resolved are replaced with a call * to this method. This method will generate a runtime errors. A good * stylesheet checks whether the function exists using conditional * constructs, and never really tries to call it if it doesn't exist. * But simple stylesheets may result in a call to this method. * The compiler should generate a warning if it encounters a call to * an unresolved external function. */ public static void unresolved_externalF(String name) { runTimeError(EXTERNAL_FUNC_ERR, name); }
/** * Utility function to throw a runtime error on the use of an extension * function when the secure processing feature is set to true. */ public static void unallowed_extension_functionF(String name) { runTimeError(UNALLOWED_EXTENSION_FUNCTION_ERR, name); }
/** * Utility function to throw a runtime error on the use of an extension * element when the secure processing feature is set to true. */ public static void unallowed_extension_elementF(String name) { runTimeError(UNALLOWED_EXTENSION_ELEMENT_ERR, name); }
/** * Utility function to throw a runtime error for an unsupported element. * * This is only used in forward-compatibility mode, when the control flow * cannot be determined. In 1.0 mode, the error message is emitted at * compile time. */ public static void unsupported_ElementF(String qname, boolean isExtension) { if (isExtension) runTimeError(UNSUPPORTED_EXT_ERR, qname); else runTimeError(UNSUPPORTED_XSL_ERR, qname); }
public static void runTimeError(String code, Object arg0) { runTimeError(code, new Object[]{ arg0 } ); }
/** * Utility function used to convert references to DOMs. */ public static DOM referenceToResultTree(Object obj) { try { return ((DOM) obj); } catch (IllegalArgumentException e) { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, "reference", className); return null; } }
/** * XSLT Standard function system-property(name) */ public static String system_propertyF(String name) { if (name.equals("xsl:version")) return("1.0"); if (name.equals("xsl:vendor")) return("Apache Software Foundation (Xalan XSLTC)"); if (name.equals("xsl:vendor-url")) return("http://xml.apache.org/xalan-j"); runTimeError(INVALID_ARGUMENT_ERR, name, "system-property()"); return(EMPTYSTRING); }
/** * Utility function: used to convert reference to long. */ public static long referenceToLong(Object obj) { if (obj instanceof Number) { return ((Number) obj).longValue(); // handles Integer and Double } else { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, className, Long.TYPE); return 0; } }
/** * Utility function: used to convert reference to double. */ public static double referenceToDouble(Object obj) { if (obj instanceof Number) { return ((Number) obj).doubleValue(); // handles Integer and Double } else { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, className, Double.TYPE); return 0; } }
/** * Utility function: used to convert reference to boolean. */ public static boolean referenceToBoolean(Object obj) { if (obj instanceof Boolean) { return ((Boolean) obj).booleanValue(); } else { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, className, Boolean.TYPE); return false; } }
/** * Utility function to check if a name is a valid ncname * This method should only be invoked if the attribute value is an AVT */ public static void checkNCName(String name) { if (!XML11Char.isXML11ValidNCName(name)) { runTimeError(INVALID_NCNAME_ERR,name); } }
public void addAttribute(String name, String value) { if (_openElementName != null) { _attributes.add(name, value); } else { BasisLibrary.runTimeError(BasisLibrary.STRAY_ATTRIBUTE_ERR, name); } }
/** * Utility function to check if a name is a valid qname * This method should only be invoked if the attribute value is an AVT */ public static void checkQName(String name) { if (!XML11Char.isXML11ValidQName(name)) { runTimeError(INVALID_QNAME_ERR,name); } }
public DTMAxisIterator cloneIterator() { try { final NthIterator clone = (NthIterator) super.clone(); clone._source = _source.cloneIterator(); // resets source clone._isRestartable = false; return clone; } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
public DTMAxisIterator cloneIterator() { try { final MatchingIterator clone = (MatchingIterator) super.clone(); clone._source = _source.cloneIterator(); clone._isRestartable = false; return clone.reset(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
public DTMAxisIterator cloneIterator() { try { final FilterIterator clone = (FilterIterator) super.clone(); clone._source = _source.cloneIterator(); clone._isRestartable = false; return clone.reset(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
public DTMAxisIterator cloneIterator() { try { final AbsoluteIterator clone = (AbsoluteIterator) super.clone(); clone._source = _source.cloneIterator(); // resets source clone.resetPosition(); clone._isRestartable = false; return clone; } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
public DTMAxisIterator cloneIterator() { try { NodeValueIterator clone = (NodeValueIterator)super.clone(); clone._source = _source.cloneIterator(); clone.setRestartable(false); return clone.reset(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
public DTMAxisIterator cloneIterator() { try { final CurrentNodeListIterator clone = (CurrentNodeListIterator) super.clone(); clone._nodes = (IntegerArray) _nodes.clone(); clone._source = _source.cloneIterator(); clone._isRestartable = false; return clone.reset(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
public DTMAxisIterator cloneIterator() { try { final DupFilterIterator clone = (DupFilterIterator) super.clone(); clone._nodes = (IntegerArray) _nodes.clone(); clone._source = _source.cloneIterator(); clone._isRestartable = false; return clone.reset(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }