Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-376

Get Metadata from Open Office Files

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 0.5-incubating, 0.6-incubating
    • 0.5-incubating
    • odfdom
    • 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);
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            guzman Guzman Rejon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: