Changeset 630

Show
Ignore:
Timestamp:
04/20/06 16:35:03
Author:
miyagawa
Message:

Subscription::OPML: support broken OPML feed. use XML::Liberal if installed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Subscription/OPML.pm

    r277 r630  
    66use URI; 
    77use XML::OPML; 
     8 
     9our $HAS_LIBERAL; 
     10BEGIN { 
     11    eval { require XML::Liberal; $HAS_LIBERAL = 1 }; 
     12} 
    813 
    914sub register { 
     
    5055    else { 
    5156        $context->error("Unsupported URI scheme: " . $uri->scheme); 
     57    } 
     58 
     59    if ($HAS_LIBERAL) { 
     60        my $parser = XML::Liberal->new('LibXML'); 
     61        my $doc = $parser->parse_string($xml); 
     62        $xml = $doc->toString; 
    5263    } 
    5364