camelmanos has asked for the wisdom of the Perl Monks concerning the following question:
Hello and good day to all!
This is the full code:
#!/usr/bin/perl use XML::XPath; use XML::XPath::XMLParser; open (FILE, 'list.txt'); my @contents=<FILE>; close(FILE); foreach my $content (@contents) { if($content =~ m/(\d+)_(\d+)/) { $vid = $1; $xmlfile = "$vid.mp7.xml"; my $xp = XML::XPath->new(filename => $xmlfile); $var = '/Mpeg7/Description/MultimediaContent/Video/Tem +poralDecomposition/VideoSegment[@id="$content"]/MediaTime/MediaTimePo +int'; my $data = $xp->getNodeText($var); print "$data \n"; }; };
Actually, I found out what was going on by doing the obvious...I changes @id="content" for attribute::id="content" (unabbreviated syntax) and it worked fine...I don't know if it should be reported as a bug! Thanks anyway!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: First Question
by Corion (Patriarch) on Jan 14, 2009 at 10:12 UTC | |
|
Re: First Question
by DrHyde (Prior) on Jan 14, 2009 at 10:53 UTC |