/** * declaratoin: "data" for XML declaration, such as "version=\"1.0\"" * publicId: publicId for DOCTYPE declaration */ public void convert(InputStream input, OutputStream output, String declaration, String publicId) throws UnsupportedEncodingException, IOException, CoreException { IDOMModel model = readModel(input); if (model == null) return; try { convert(model, declaration, publicId); writeModel(model, output); } finally { if (model != null) model.releaseFromEdit(); } }
/** * declaratoin: "data" for XML declaration, such as "version=\"1.0\"" * publicId: publicId for DOCTYPE declaration */ public void convert(IFile file, String declaration, String publicId) throws IOException, CoreException { IDOMModel model = readModel(file); if (model == null) return; try { convert(model, declaration, publicId); writeModel(model, file); } finally { if (model != null) model.releaseFromEdit(); } }