Help for this page

Select Code to Download


  1. or download this
    foreach ($doc->findnodes('/library/cd/artist/text()'){
       my $artist = $_->data;
       if ($artist){
    ...
          print "0 | ";
       }
    }
    
  2. or download this
    foreach ($doc->findnodes('/library/cd/artist')){   #update: added ')'
       my $artist = $_->to_literal;
       if ($artist){
    ...
          # you can use $_->appendTextNode('text to add') here
       }
    }
    
  3. or download this
    foreach ($doc->findnodes('/library/cd/artist[not(text())]'){