Help for this page

Select Code to Download


  1. or download this
    <?xml version="1.0" encoding="UTF-8"?> 
    <feed xmlns="http://www.w3.org/2005/Atom" xmlns:db="http://www.douban.
    +com/xmlns/" xmlns:gd="http://schemas.google.com/g/2005" 
    ...
    <db:uid>movie007wn</db:uid> 
    </entry> 
    </feed>
    
  2. or download this
    my $xml = XML::XPath->new( xml => $string); 
    my $nodeset = $xml->findnodes('//entry'); 
    foreach my $node ( $nodeset->get_nodelist){ 
    print $node->findvalue('//title'),"\n"; 
    }
    
  3. or download this
    my $xml = XML::LibXML->new->parse_string( $string); 
    my @nodeset = $xml->find('//entry'); 
    print Dumper @nodeset;
    
  4. or download this
    my $node = XML::LibXML->new->parse_string($string);
    my $xml = XML::LibXML::XPathContext->new( $node);
    $xml->registerNs('atom','http://www.w3.org/2005/Atom');
    my @nodeset = $xml->findnodes('//atom:entry');
    print $xml->findvalue('//atom:id',$nodeset[0]);