Subject: | Bug in XPath prevents Flat XML support |
OpenOffice::OODoc::XPath::_get_flat_file contains a typo which breaks Flat XML support. I am attaching a fix.
P.S.
Another issue that I've run into is that to use the Flat XML format, I have to specify "element" in the constructor:
my $doc = odfDocument(file => $input_filename,
flat_xml => 1,
element => 'office:document',
);
I think this should be in the documentation.
Subject: | flat-xml-patch.txt |
--- XPath.pm-orig 2014-11-07 12:01:30.388001621 -0500
+++ XPath.pm-fix 2014-11-07 12:02:49.505001481 -0500
@@ -458,10 +458,9 @@ sub _get_flat_file # get fl
{
my $doc = shift;
my $source = $doc->{'file'};
- $doc->{'xpath'} = UNIVERSAL::isa($source, 'IO::File') ?
+ return UNIVERSAL::isa($source, 'IO::File') ?
$doc->{'twig'}->safe_parse($source) :
$doc->{'twig'}->safe_parsefile($source);
- return $doc->{'path'};
}
sub new