carcassonne has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to simply retrieve some info from a OpenOffice Draw document section using XML::Twig. I have tried several variations but can't get to the data inside the section.
I'd like to be able to read the 'draw:name' in the following:
<draw:frame draw:id="id2" draw:layer="layout" draw:name="objectName" d +raw:style-name="gr1" draw:text-style-name="P3" [svg skipped] <draw:text-box> <text:p text:style-name="P1"> <text:span text:style-name="T2">objectData</text:span> </text:p> </draw:text-box> </draw:frame>
I can get the 'objectData' text of that draw:frame section. How can the draw:name attribute be read ? Here's what I do to get the text:
my $twig = XML::Twig->new ( parse_param_ent => 1, twig_handlers => { 'draw:frame' => \&getDrawInfo, }, ); $twig->parsefile("file.xml"); sub getDrawInfo { my ($t, $data)= @_; print "DEBUG " . $data->text . "\n"; }
I've tried accessing subsections of draw:frame in many ways although none of them returned the draw:name attribute
Thanks for any suggestions/insight.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Twig and oodraw
by toolic (Bishop) on Oct 09, 2009 at 15:18 UTC | |
by carcassonne (Pilgrim) on Oct 09, 2009 at 15:33 UTC | |
|
Re: XML::Twig and oodraw
by mickep76 (Beadle) on Oct 09, 2009 at 15:08 UTC | |
by carcassonne (Pilgrim) on Oct 09, 2009 at 15:13 UTC | |
by mirod (Canon) on Oct 09, 2009 at 15:30 UTC |