#!/usr/bin/perl use strict; use XML::LibXML; use HTML::Entities; use CGI; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use Fcntl qw(:flock); my $cgi = new CGI; print "Content-type: text/html\n\n"; my $file_dati = "../data/xml/guestbook_xml.xml"; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file($file_dati) || die("dead1"); my $root = $doc->getDocumentElement || die("dead2"); my $nodetobefound= "xs:commento[xs:\@timestamp='20130903225513']"; print "$nodetobefound\n"; my $commento = $root->findnodes("$nodetobefound") || die("dead3"); print $commento->get_node(0)->toString();