/** * Parse the contents of this <xsltc:output> element. The only attribute * we recognise is the 'file' attribute that contains teh output filename. */ public void parseContents(Parser parser) { // Get the output filename from the 'file' attribute String filename = getAttribute("file"); // If the 'append' attribute is set to "yes" or "true", // the output is appended to the file. String append = getAttribute("append"); // Verify that the filename is in fact set if ((filename == null) || (filename.equals(EMPTYSTRING))) { reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "file"); } // Save filename as an attribute value template _filename = AttributeValue.create(this, filename, parser); if (append != null && (append.toLowerCase().equals("yes") || append.toLowerCase().equals("true"))) { _append = true; } else _append = false; parseChildren(parser); }
/** * Displays the contents of this <xsltc:output> element. */ public void display(int indent) { indent(indent); Util.println("TransletOutput: " + _filename); }
/** * Type checks the 'file' attribute (must be able to convert it to a str). */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type type = _filename.typeCheck(stable); if (type instanceof StringType == false) { _filename = new CastExpr(_filename, Type.String); } typeCheckContents(stable); return Type.Void; }
translateContents(classGen, methodGen);
translateContents(classGen, methodGen);
/** * Parse the contents of this <xsltc:output> element. The only attribute * we recognise is the 'file' attribute that contains teh output filename. */ public void parseContents(Parser parser) { // Get the output filename from the 'file' attribute String filename = getAttribute("file"); // If the 'append' attribute is set to "yes" or "true", // the output is appended to the file. String append = getAttribute("append"); // Verify that the filename is in fact set if ((filename == null) || (filename.equals(EMPTYSTRING))) { reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "file"); } // Save filename as an attribute value template _filename = AttributeValue.create(this, filename, parser); if (append != null && (append.toLowerCase().equals("yes") || append.toLowerCase().equals("true"))) { _append = true; } else _append = false; parseChildren(parser); }
/** * Displays the contents of this <xsltc:output> element. */ public void display(int indent) { indent(indent); Util.println("TransletOutput: " + _filename); }
/** * Type checks the 'file' attribute (must be able to convert it to a str). */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type type = _filename.typeCheck(stable); if (type instanceof StringType == false) { _filename = new CastExpr(_filename, Type.String); } typeCheckContents(stable); return Type.Void; }