kkavitha has asked for the wisdom of the Perl Monks concerning the following question:
<?xml version='1.0' ?> <Product name="terminal" no="...> <Module name="nw"> <SourceDir name="/testnw/nwtool" /> </Module> <Module name="hw"> <SourceDir name="/prod/hw" /> <SourceDir name="/test/hw" /> </Module> </Product>
I want to get the sourcedirectories per module wise. Tried with XML:Xpath,
Used: foreach my $Module($xp->find('//Module')->get_nodelist){ foreach my $SourceDir ($Module->find('//SourceDir')->get_nodelist){ my $dir = $SourceDir->find('@name')->string_value;
it is giving all sourcedirectories for each module. Let me know if you have any idea.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get the node value of each node?
by derby (Abbot) on Aug 17, 2009 at 12:36 UTC | |
by kkavitha (Initiate) on Aug 17, 2009 at 13:42 UTC | |
|
Re: How to get the node value of each node?
by Anonymous Monk on Aug 17, 2009 at 11:04 UTC |