#!/usr/bin/perl
use strict;
use XML::XPath;
use XML::XPath::XMLParser;
use XML::XPath::Node::Element;
use XML::XPath::NodeSet;
my $file = "nci.xml";
my $xp = XML::XPath-> new(filename => $file);
open(info,"+>$file.txt");
foreach my $concept ($xp->findnodes('/NCI_PID_XML/Ontology/LabelType')) {
my $parentid = $concept->getAttribute('id');
my $type = $concept->getAttribute('name');
my $LabelValue = $concept->findnodes('LabelValueList');
my $id = $LabelValue->getAttribute('id');
my $name = $LabelValue->getAttribute('name');
my $goid = $LabelValue->getAttribute('GO');
print info "$parentid\t";
print info "$type\t";
print info "id\t";
print info "name\t";
print info "$goid\n";
}
but it is giving me error In reply to Re^2: problems with Xpath
by Anonymous Monk
in thread problems with Xpath
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |