Changeset 2029

Show
Ignore:
Timestamp:
10/11/06 16:50:40
Author:
miyagawa
Message:

added attrs method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • XML-OPML-LibXML/trunk/lib/XML/OPML/LibXML.pm

    r2024 r2029  
    5151  my @outline = $doc->outline; 
    5252  for my $outline (@outline) { 
     53      my $attrs = $attr->attrs;      # hashref 
    5354      $outline->title; 
    5455      $outline->text; 
  • XML-OPML-LibXML/trunk/lib/XML/OPML/LibXML/Outline.pm

    r2024 r2029  
    1313    my($self, $attr) = @_; 
    1414    $self->{elem}->getAttribute($attr); 
     15} 
     16 
     17sub attrs { 
     18    my $self = shift; 
     19 
     20    my %attr; 
     21    for my $attr ($self->{elem}->attributes) { 
     22        $attr{$attr->name} = $attr->value; 
     23    } 
     24 
     25    \%attr; 
    1526} 
    1627