Hello, I am trying to concatenate 2 odt files, but I am getting an 
exception at this line:

*ODSingleXMLDocument.createFromStream(is)*

error: exception in thread "main" org.jdom.input.JDOMParseException: Error 
on line 1: Content is not allowed in prolog.

source code:

package com.mycompany.jopendocument;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.jdom.JDOMException;
import org.jopendocument.dom.ODSingleXMLDocument;
import org.jopendocument.dom.OOUtils;

public class Main {

    public static void main(String[] args) throws JDOMException, 
IOException {
        File f1 = new File("c:/arquivos/arquivo1.odt");
        InputStream is = new FileInputStream(f1);
        ODSingleXMLDocument p1 = ODSingleXMLDocument.createFromStream(is);
        File f2 = new File("c:/arquivos/arquivo2.odt");
        ODSingleXMLDocument p2 = ODSingleXMLDocument.createFromPackage(f2);
        p1.add(p2);
        OOUtils.open(p1.saveToPackageAs(new File("cat")));
    }

}

The method createFromPackage works, but createFromStream does not work.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to