GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
XML::OPML::LibXML(3) User Contributed Perl Documentation XML::OPML::LibXML(3)

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
2006-10-11 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.