boolean hasSimpleArgs = hasSimpleType(left) && hasSimpleType(right); right = new Boolean(booleanF(right)); hasSimpleArgs = true; left = new Boolean(booleanF(left)); hasSimpleArgs = true; switch (op) { case Operators.GT: return numberF(left, dom) > numberF(right, dom); return numberF(left, dom) < numberF(right, dom); return numberF(left, dom) >= numberF(right, dom); return numberF(left, dom) <= numberF(right, dom); runTimeError(RUN_TIME_INTERNAL_ERR, "compare()"); result = booleanF(left) == booleanF(right); result = numberF(left, dom) == numberF(right, dom); result = stringF(left, dom).equals(stringF(right, dom)); if (hasSimpleType(left) || left instanceof DOM && right instanceof DTMAxisIterator) {
/** * Utility function: node-set/string comparison. */ public static boolean compare(DTMAxisIterator left, final String rstring, int op, DOM dom) { int node; //left.reset(); while ((node = left.next()) != DTMAxisIterator.END) { if (compareStrings(dom.getStringValueX(node), rstring, op, dom)) { return true; } } return false; }
/** * Utility function: used in RealType to convert a real to a string. * Removes the decimal if null. */ public static String realToString(double d) { final double m = Math.abs(d); if ((m >= lowerBounds) && (m < upperBounds)) { final String result = Double.toString(d); final int length = result.length(); // Remove leading zeros. if ((result.charAt(length-2) == '.') && (result.charAt(length-1) == '0')) return result.substring(0, length-2); else return result; } else { if (Double.isNaN(d) || Double.isInfinite(d)) return(Double.toString(d)); return formatNumber(d, defaultPattern, defaultFormatter); } }
boolean ignoreDefault) { String expandedQName; String prefix = getPrefix(lexicalQName); String localName = (prefix != null) ? lexicalQName.substring(prefix.length()+1) : lexicalQName; String uri = lookupStylesheetQNameNamespace(lexicalQName, stylesheetNodeID, ancestorNodeIDs, runTimeError(NAMESPACE_PREFIX_ERR, prefix);
runTimeError(NAMESPACE_PREFIX_ERR,prefix); prefix = generatePrefix(); qname = prefix + ':' + qname; handler.startElement(namespace, qname, qname);
/** * Get the value of a parameter from the current frame or * <tt>null</tt> if undefined. */ public final Object getParameter(String name) { name = BasisLibrary.mapQNameToJavaName (name); for (int i = pframe - 1; i >= pbase; i--) { final Parameter param = (Parameter)paramsStack.get(i); if (param._name.equals(name)) return param._value; } return null; }
/** * XSLT Standard function normalize-space(string). */ public static String normalize_spaceF(String value) { int i = 0, n = value.length(); StringBuffer result = new StringBuffer(); while (i < n && isWhiteSpace(value.charAt(i))) i++; while (true) { while (i < n && !isWhiteSpace(value.charAt(i))) { result.append(value.charAt(i++)); } if (i == n) break; while (i < n && isWhiteSpace(value.charAt(i))) { i++; } if (i < n) result.append(' '); } return result.toString(); }
String[] prefixURIPairs, boolean ignoreDefault) { String prefix = getPrefix(lexicalQName); String uri = "";
boolean ignoreDefault) { String expandedQName; String prefix = getPrefix(lexicalQName); String localName = (prefix != null) ? lexicalQName.substring(prefix.length()+1) : lexicalQName; String uri = lookupStylesheetQNameNamespace(lexicalQName, stylesheetNodeID, ancestorNodeIDs, runTimeError(NAMESPACE_PREFIX_ERR, prefix);
/** * Add a new global parameter if not already in the current frame. * To setParameters of the form {http://foo.bar}xyz * This needs to get mapped to an instance variable in the class * The mapping created so that * the global variables in the generated class become * http$colon$$flash$$flash$foo$dot$bar$colon$xyz */ public final Object addParameter(String name, Object value) { name = BasisLibrary.mapQNameToJavaName (name); return addParameter(name, value, false); }
runTimeError(NAMESPACE_PREFIX_ERR,prefix); prefix = generatePrefix(); qname = prefix + ':' + qname; handler.startElement(namespace, qname, qname);
/** * XSLT Standard function normalize-space(string). */ public static String normalize_spaceF(String value) { int i = 0, n = value.length(); StringBuffer result = new StringBuffer(); while (i < n && isWhiteSpace(value.charAt(i))) i++; while (true) { while (i < n && !isWhiteSpace(value.charAt(i))) { result.append(value.charAt(i++)); } if (i == n) break; while (i < n && isWhiteSpace(value.charAt(i))) { i++; } if (i < n) result.append(' '); } return result.toString(); }
String[] prefixURIPairs, boolean ignoreDefault) { String prefix = getPrefix(lexicalQName); String uri = "";
boolean hasSimpleArgs = hasSimpleType(left) && hasSimpleType(right); right = new Boolean(booleanF(right)); hasSimpleArgs = true; left = new Boolean(booleanF(left)); hasSimpleArgs = true; switch (op) { case Operators.GT: return numberF(left, dom) > numberF(right, dom); return numberF(left, dom) < numberF(right, dom); return numberF(left, dom) >= numberF(right, dom); return numberF(left, dom) <= numberF(right, dom); runTimeError(RUN_TIME_INTERNAL_ERR, "compare()"); result = booleanF(left) == booleanF(right); result = numberF(left, dom) == numberF(right, dom); result = stringF(left, dom).equals(stringF(right, dom)); if (hasSimpleType(left) || left instanceof DOM && right instanceof DTMAxisIterator) {
boolean ignoreDefault) { String expandedQName; String prefix = getPrefix(lexicalQName); String localName = (prefix != null) ? lexicalQName.substring(prefix.length()+1) : lexicalQName; String uri = lookupStylesheetQNameNamespace(lexicalQName, stylesheetNodeID, ancestorNodeIDs, runTimeError(NAMESPACE_PREFIX_ERR, prefix);
final String name = BasisLibrary.mapQNameToJavaName (_name.toString()); final String signature = _type.toSignature();
runTimeError(NAMESPACE_PREFIX_ERR,prefix); prefix = generatePrefix(); qname = prefix + ':' + qname; handler.startElement(namespace, qname, qname);
/** * Utility function: node-set/node-set compare. */ public static boolean compare(DTMAxisIterator left, DTMAxisIterator right, int op, DOM dom) { int lnode; left.reset(); while ((lnode = left.next()) != DTMAxisIterator.END) { final String lvalue = dom.getStringValueX(lnode); int rnode; right.reset(); while ((rnode = right.next()) != DTMAxisIterator.END) { // String value must be the same if both nodes are the same if (lnode == rnode) { if (op == Operators.EQ) { return true; } else if (op == Operators.NE) { continue; } } if (compareStrings(lvalue, dom.getStringValueX(rnode), op, dom)) { return true; } } } return false; }
/** * XSLT Standard function normalize-space(string). */ public static String normalize_spaceF(String value) { int i = 0, n = value.length(); StringBuffer result = new StringBuffer(); while (i < n && isWhiteSpace(value.charAt(i))) i++; while (true) { while (i < n && !isWhiteSpace(value.charAt(i))) { result.append(value.charAt(i++)); } if (i == n) break; while (i < n && isWhiteSpace(value.charAt(i))) { i++; } if (i < n) result.append(' '); } return result.toString(); }
/** * Utility function: used in RealType to convert a real to a string. * Removes the decimal if null. */ public static String realToString(double d) { final double m = Math.abs(d); if ((m >= lowerBounds) && (m < upperBounds)) { final String result = Double.toString(d); final int length = result.length(); // Remove leading zeros. if ((result.charAt(length-2) == '.') && (result.charAt(length-1) == '0')) return result.substring(0, length-2); else return result; } else { if (Double.isNaN(d) || Double.isInfinite(d)) return(Double.toString(d)); return formatNumber(d, defaultPattern, defaultFormatter); } }