karpatov has asked for the wisdom of the Perl Monks concerning the following question:
#!/bin/perl -w use strict; use XML::Twig; my $leader_name; my $leader_score=0; #my $field0= 'PC-Compound'; my $field1= 'PC-CompoundType_id_cid'; my $field2= 'PC-InfoData_value_binary'; my $twig= new XML::Twig( twig_roots => {$field1 => 1, $field2 => 1 +} ); $twig->parsefile( "D:/NCI-Open/vice shlavickou.xml"); my $root= $twig->root; my @cpds= $root->children_text($field1); my @bins= $root->children_text($field2); print "@cpds\n"; print "@bins\n"; #$twig->print;
<PC-Compound> <PC-Compound_id> <PC-CompoundType> <PC-CompoundType_id> <PC-CompoundType_id_cid>1</PC-CompoundType_id_cid> </PC-CompoundType_id> </PC-CompoundType> </PC-Compound_id> <PC-Compound_atoms> </PC-Compound_atoms> <PC-Compound_props> <PC-InfoData> </PC-InfoData> <PC-InfoData> <PC-InfoData_urn> <PC-Urn> </PC-Urn> </PC-InfoData_urn> <PC-InfoData_value> <PC-InfoData_value_binary>00000371E0723800000000000000000000 +000000000000000000000000000000000000000000001E00000000000814E18006020 +803000400080000900800000000000000000001080000020014008000070000052000 +1000002400000000000000000000000000000000000000000000000000</PC-InfoDa +ta_value_binary> </PC-InfoData_value> </PC-InfoData> <PC-InfoData> </PC-InfoData> </PC-Compound>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 1GB XML mining with XML:twig (newbies question)
by pc88mxer (Vicar) on Feb 16, 2008 at 01:28 UTC | |
|
Re: 1GB XML mining with XML:twig (newbies question)
by graff (Chancellor) on Feb 16, 2008 at 16:08 UTC | |
by Anonymous Monk on Feb 16, 2008 at 19:08 UTC | |
by karpatov (Beadle) on Feb 18, 2008 at 16:00 UTC | |
|
Re: 1GB XML mining with XML:twig (newbies question)
by Jenda (Abbot) on Feb 18, 2008 at 15:52 UTC |