Thread

Posted on Tue Jul 25 21:20:30 2006 by dab
cannot open 'styles' member
opening a document with
my $doc = ooDocument ( file => $filename );
I get no error, but I find that all named styles are invisible (methods like getNamedStyleRoot() simply return no result at all). After much debugging, it occurred to me that the 'styles' member is not visible. Attempting to explicitly open
my $styledoc = ooDocument(file => $filename, member => 'styles');
the script dies, saying
Can't call method "att" on an undefined value at /Library/Perl/5.8.1/OpenOffice/OODoc/XPath.pm line + 295.
What may be the meaning of this? Is it a bug in XPath.pm?
-- dab
Direct Responses: 2701 | 2724 | Write a response
Posted on Tue Jul 25 21:46:48 2006 by dab in response to 2699
Re: cannot open 'styles' member
checking XPath.pm, I find that the error occurs in
sub isOpenDocument
, looking at
att('xmlns:office')
. Examining the styles.xml file of my document, I find that a
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
tag is present. What is going on?
-- dab
Direct Responses: 2703 | Write a response
Posted on Wed Jul 26 11:52:14 2006 by jmgdoc in response to 2701
Re: cannot open 'styles' member
Looks strange...
Could you post the full script, and your O::O version ?
Direct Responses: 2704 | Write a response
Posted on Wed Jul 26 15:25:13 2006 by dab in response to 2703
Re: cannot open 'styles' member
I managed to isolate the error, the following reproduces it:
#! /usr/bin/perl use OpenOffice::OODoc; my $filename="test.odt"; my $target=$filename; $target=~s/(.+)\./$1.usc./; my $oofile = ooFile($filename) or die "could not open $filename\n"; my $styledoc = ooDocument(file => $oofile, member => 'styles');

note that the ~s operation on $target is needed to reproduce it. It appears to depend on it containing the $1, since replacing it with
$target=~s/.+\./$&usc./;
does not give the error. Realizing this makes it of course easy to avoid the problem, but it is of course a nasty one to pin down. So to my uninformed eye it looks like ooDocument has a problem when called with $1 initiated (or something similar), which is of course a bug. My version is current (OpenOffice-OODoc-2.026). thank you
-- dab
Write a response
Posted on Thu Jul 27 17:33:03 2006 by ran in response to 2699
Re: cannot open 'styles' member
Hi, I have a really interesting opportunity for configuration managers who have experience with configuration tools in a high tech company. If you are interested, or know any one who might be - contact me: Ran Peled, 972-54-2270760 ran@mishoo.co.il Good Luck!
Write a response