Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi guys, Thank you for your quicky replies. I think I found what's wrong inside xml document. It seems that only if a link contains character '&' then the parser reports an error. For example, <link r:resource="http://www.urbancinefile.com.au/home/article_view.asp?Article_ID=3801&Section=Reviews"/> As I need to read <link/> elements one by one and compare the attribute value with user's input, my new question is, how can I overcome this '&' problem? I have tried to use '\' before '&' but it doesn't work. Thanks again,
sub topic {
Nan my $count = 0; my ($twig, $topic) = @_; $links{$_->att('r:resource')} = $_ for $topic->children('link'); foreach my $key (keys %links){ if ($key =~ /$q/i){ print " $count++; } last if ($count == 1); #if keywords were found in one link, we don't need to check the others in the same node, because we aim to output parent category only. } print "\n"; $twig->purge; %links = (); #reset the hash for next time use } In reply to Re^2: Why XML not well formed?
by nan
|
|