Changeset 1623

Show
Ignore:
Timestamp:
08/25/05 07:35:16
Author:
miyagawa
Message:

libxmlified: 0.07

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WebService-Bloglines/trunk/Changes

    r1622 r1623  
    11Revision history for Perl extension WebService::Bloglines 
     2 
     30.07  Wed Aug 24 22:34:20 UTC 2005 
     4        - uses LibXML everywhere, removed XML::XPath and XML::RSS dependency 
    25 
    360.06  Wed Aug 24 22:15:21 UTC 2005 
  • WebService-Bloglines/trunk/Makefile.PL

    r1508 r1623  
    66        Test::More => 0.32, 
    77        LWP => 0, 
    8         XML::RSS => 0, 
    9         XML::XPath => 0, 
     8        XML::RSS::LibXML => 0, 
    109    }, 
    1110); 
  • WebService-Bloglines/trunk/lib/WebService/Bloglines.pm

    r1622 r1623  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.06
     5$VERSION = 0.07
    66 
    77use LWP::UserAgent; 
  • WebService-Bloglines/trunk/lib/WebService/Bloglines/Entries.pm

    r1508 r1623  
    22 
    33use vars qw($VERSION); 
    4 $VERSION = 0.01
     4$VERSION = 0.07
    55 
    66use strict; 
    7 use XML::RSS
    8 use XML::XPath
     7use XML::RSS::LibXML
     8use XML::LibXML
    99use HTML::Entities; 
    1010 
    1111sub parse { 
    1212    my($class, $xml) = @_; 
    13     my $xp = XML::XPath->new(ioref => $xml); 
    14     my $rssparent = $xp->find("/rss")->get_node(0); 
    15     my $channelnode = $xp->find("/rss/channel"); 
     13 
     14    my $parser = XML::LibXML->new; 
     15    my $doc    = $parser->parse_string($xml); 
     16    my $rssparent   = $doc->find("/rss")->get_node(0); 
     17    my $channelnode = $doc->find("/rss/channel"); 
     18    $rssparent->removeChildNodes(); 
    1619 
    1720    my @entries; 
    1821    for my $node ($channelnode->get_nodelist()) { 
    19         my $xml = $rssparent->toString(1); # norecurse 
     22        my $xml = $rssparent->toString(); 
    2023        my $channel = $node->toString(); 
    21         $xml =~ s!</rss>$!\n$channel\n</rss>!; # wooh 
     24        $xml =~ s!<(rss.*?)/>$!<$1>\n$channel\n</rss>!; # wooh 
    2225        push @entries, $class->new($xml); 
    2326    } 
     
    3740    my $self = shift; 
    3841 
    39     my $rss = XML::RSS->new(); 
     42    my $rss = XML::RSS::LibXML->new(); 
    4043    $rss->add_module(prefix => "bloglines", uri => "http://www.bloglines.com/services/module"); 
    4144    $rss->parse($self->{_xml});