Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
0.5-incubating, 0.6-incubating
-
Windows 7, java 1.7
Description
I need to modify only the Open Office file metadata. How I can do it without loading the entire file into memory (file.odt)?
I need to work only with the file: meta.xml and label: <office:meta> ... metadata ... </ office: meta>
My code loads the meta.xml file but I can not get metadata:
OdfPackage pkg = OdfPackage.loadPackage(new File("file.odt"));
Node d = pkg.getDom("meta.xml").getElementsByTagName("office:document-meta").item(0);
for(int i =0; i<d.getAttributes().getLength();i++) {
String nombre = d.getAttributes().item.getNodeName();
String valor = d.getAttributes().item.getNodeValue();
System.out.println("Clave: " + nombre + " valor: " + valor);
}