Changeset 17354 for lang/perl/MooseX-DOM

Show
Ignore:
Timestamp:
08/11/08 08:52:30 (6 years ago)
Author:
daisuke
Message:

Add from_xml/from_file so that implementors can parse from sources without knowing the details

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/MooseX-DOM/trunk/lib/MooseX/DOM/LibXML.pm

    r17335 r17354  
    306306} 
    307307 
     308sub from_xml { 
     309    my $class = shift; 
     310    return $class->new(node => XML::LibXML->new->parse_string($_[0])->documentElement); 
     311} 
     312sub from_file { 
     313    my $class = shift; 
     314    return $class->new(node => XML::LibXML->new->parse_file($_[0])->documentElement); 
     315} 
     316 
    308317sub as_xml { 
    309318    my $self = shift;