#!/usr/bin/perl -w use XML::DOM; use strict; my ($file, @rubbish) = @ARGV; if ($#ARGV > 0 ){ die; } else { my $parser = new XML::DOM::Parser; my $doc = $parser->parsefile($file); my $root = $doc->getDocumentElement(); scanner($root); sub scanner { my ($rt) = @_; my @list; foreach my $track ($rt->getElementsByTagName('track')) { foreach my $el ( $track->getChildNodes()) { foreach my $attr ( $el->getChildNodes()) { if ($attr->getNodeType == ELEMENT_NODE) { if ($attr-> getAttribute('name') eq "type"){ foreach my $type ($attr->getChildNodes()){ push (@list, $type->getData()); } } } } } }print "@list"; } } #### description/assertion command etc, #### - abstract description/assertion - abstract command #### - abstract description/assertion - abstract command