XML::OPML::LibXML - Parse OPML document with LibXML parser
use XML::OPML::LibXML; my $parser = XML::OPML::LibXML->new; my $doc = $parser->parse_file($opml_file); # Alternatively, you can create Document object using XML::LibXML::Document use XML::LibXML; my $dom = XML::LibXML->new->parse_file($opml_file); my $doc = XML::OPML::LibXML::Document->new_from_doc($dom); # OPML document head properties $doc->title; $doc->date_created; $doc->date_modified; $doc->owner_name; # XML::OPML::LibXML::Outline my @outline = $doc->outline; for my $outline (@outline) { my $attrs = $attr->attrs; # hashref $outline->title; $outline->text; if ($outline->is_container) { my @outline = $outline->children; # do some recursive stuff, see also walkdown() } else { $outline->type; $outline->xml_url; $outline->html_url; } } # depth-first walkdown the tree $doc->walkdown(\&callback); sub callback { my $outline = shift; # ... }
XML::OPML::LibXML is an OPML parser written using XML::LibXML. This module is part of spin-off CPANization of Plagger plugins.
For now, all this module does is just parsing an OPML document. The API is very simple and limited to low-level access, yet.
NOTE: This module is not designed to be a drop-in replacement of XML::OPML.
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
XML::LibXML, XML::OPML, Plagger
To install XML::OPML::LibXML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::OPML::LibXML
CPAN shell
perl -MCPAN -e shell install XML::OPML::LibXML
For more information on module installation, please visit the detailed CPAN module installation guide.