Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    for my $elt ($root->look_down ('_tag' => 'a', 'attr' => '2')) {
        print $elt->as_XML (), "\n";
    }
    
  2. or download this
    All the 'a' elements
    <a attr="1">Contents of a - 1</a>
    ...
    
    All the 'a' elements with attr='2'
    <a attr="2">Contents of a - 2</a>