OpenOffice-OODoc - Error Message: No XML Content

Posted on Sat Mar 31 01:33:05 2007 by fou
Error Message: No XML Content

(1) I used the OpenOffice::OODoc module to create a simple .odt file with the words "Hello World !"

(2) I opened the file ("hello_world.odt") in OpenOffice and it had the message as expected.

(3) But then when I tried to read from the file using OpenOffice::OODoc, I got the following message:

[OpenOffice::OODoc::XPath::new] No XML content

Scripts:

(1) =========================== oo_hello_world_write.pl ===========================

use OpenOffice::OODoc; my $ar = ooFile("hello_world.odt", create => "text"); my $doc = ooDocument(archive => $ar, member => "content"); $doc->appendParagraph(text => "Hello World !", style => "Standard"); $ar->save;

(3) =========================== oo_hello_world_read.pl ===========================

use OpenOffice::OODoc; my $archive - ooFile('hello_world.odt'); my $doc = ooDocument(archive => $archive, member => 'content'); my $par = $doc->getParagraph(0);

Specifically, when I typed

perl oo_hello_world_read.pl

I got

[OpenOffice::OODoc::XPath::new] No XML content

Can't call method "getParagraph" on an undefined value at oo_hello_world_read.pl line 6.

Direct Responses: 4728 | Write a response