throws TransformerConfigurationException, TransformerException, IOException,
ParserConfigurationException {
assert (metaDataFile.getParentFile().exists());
NamespaceHelper helper = new NamespaceHelper("http://purl.org/dc/elements/1.1/", "dc",
"metadata");
Element root = helper.getDocument().getDocumentElement();
Iterator iter = dublinCoreParams.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
root.appendChild(helper.createElement((String)entry.getKey(), (String)entry.getValue()));
}
String mimeType = dublinCoreParams.get("format").toString();
if (canReadMimeType(mimeType)) {
NamespaceHelper lenyaHelper = new NamespaceHelper("http://apache.org/cocoon/lenya/page-envelope/1.0", "lenya", helper.getDocument());
Element metaElement = lenyaHelper.createElement("meta");
Iterator iterlenya = lenyaMetaParams.entrySet().iterator();
while (iterlenya.hasNext()) {
Map.Entry entry = (Map.Entry)iterlenya.next();
metaElement.appendChild(lenyaHelper.createElement((String)entry.getKey(), (String)entry.getValue()));
}
root.appendChild(metaElement);
}
DocumentHelper.writeDocument(helper.getDocument(), metaDataFile);
}