#! /usr/bin/perl
use strict;
use XML::DOM;

my $parser = new XML::DOM::Parser;
my $doc = $parser->parsefile("example1-xsd.xml");

my $nodes = $doc->getElementsByTagName("resistor");
my $n = $nodes->getLength;

for(my $i=0; $i<$n; $i++)
{
    my $node = $nodes->item($i);
    my $href = $node->getAttributeNode("resistance");
    print $href->getValue . "\n";
}

$doc->printToFile("out.xml");

print $doc->toString;

$doc->dispose;

# ;;; Local Variables: ***
# ;;; mode: Perl ***
# ;;; End: ***
