Le 15/11/2013 11:41, [email protected] a écrit :
Hello,
when trying to use the provided TextCat sample with the following command:
* java -cp /Users/bluexml/Downloads/jOpenDocument-1.3.jar
org.jopendocument.sample.TextCat
I get the following error :
org.jdom.input.JDOMParseException: Error on line 1 of document
file:/.../jOpenDocument/template/ooo2flyer_p1.odt: Contenu non autorisé
dans le prologue.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:530)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:905)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:884)
at org.jopendocument.dom.ODSingleXMLDocument.createFromFile(Unknown Source)
at org.jopendocument.sample.TextCat.main(Unknown Source)
Caused by: org.xml.sax.SAXParseException; systemId:
file:/.../jOpenDocument/template/ooo2flyer_p1.odt; lineNumber: 1;
columnNumber: 1; Contenu non autorisé dans le prologue.
...
Hi
It's a known bug in 1.3, it's fixed in trunk. The version you have calls createFromFile() which
expects flat files (e.g. .fodt), you can change the code to use package files (e.g. .odt) :
// Load 2 text documents
File file1 = new File("template/ooo2flyer_p1.odt");
ODSingleXMLDocument p1 = ODSingleXMLDocument.createFromPackage(file1);
File file2 = new File("template/ooo2flyer_p2.odt");
ODSingleXMLDocument p2 = ODSingleXMLDocument.createFromPackage(file2);
// Concatenate them
p1.add(p2);
// Save to file and Open the document with OpenOffice.org !
OOUtils.open(p1.saveToPackageAs(new File("cat")));
Cheers,
Sylvain
--
---
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/groups/opt_out.