M
Marco
Hi all,
first of all I'm non a perl-expert: I just code in perl some times...
I'm coding a tool to analyze the xml created by the websphere
performance servlet but I'm having problems with dtd documents...
This is my code:
use XML::XPath;
use XML::XPath::XMLParser;
use LWP::UserAgent;
use HTTP::Request;
my $ua = LWP::UserAgent->new;
my $url ="http://address";
my $jdbc_driver = "DB2 Universal JDBC Driver Provider";
my $req = HTTP::Request->new(GET => $url);
my $response = $ua->request($req);
my $content = $response->content();
my $xpath="/PerformanceMonitor/Node/Server/Stat/Stat/CountStatistic/
\@count";
if ($response->is_success) {
$xp = XML::XPath->new(ioref => $content );
my $nodeset = $xp->findnodes($xpath);
foreach my $node ($nodeset->get_nodelist){
print XML::XPath::XMLParser::as_string($node);
}
}
I get this output
[mstrullato@vm01 ~]$ perl ./query_was.pl
404 File `/wasPerfTool/dtd/performancemonitor.dtd' does not exist
file:///wasPerfTool/dtd/performancemonitor.dtd
Handler couldn't resolve external entity at line 8, column 160, byte
703
error in processing external entity reference at line 8, column 160,
byte 703:
<!-- not published or otherwise divested of its trade secrets,
irrespective -->
<!-- of what has been deposited with the U.S. Copyright
Office. -->
<!--
****************************************************************************--
===============================================================================================================================================================^
<PerformanceMonitor responseStatus="success" version="6.1.0.13">
at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/XML/
Parser.pm line 187
I can see that the problem is the dtd document that is not found: the
code is looking to the dtd into filesystem and not from the correct
location...
Could you help me?
Hou should I change my code?
Thanks
Marco
first of all I'm non a perl-expert: I just code in perl some times...
I'm coding a tool to analyze the xml created by the websphere
performance servlet but I'm having problems with dtd documents...
This is my code:
use XML::XPath;
use XML::XPath::XMLParser;
use LWP::UserAgent;
use HTTP::Request;
my $ua = LWP::UserAgent->new;
my $url ="http://address";
my $jdbc_driver = "DB2 Universal JDBC Driver Provider";
my $req = HTTP::Request->new(GET => $url);
my $response = $ua->request($req);
my $content = $response->content();
my $xpath="/PerformanceMonitor/Node/Server/Stat/Stat/CountStatistic/
\@count";
if ($response->is_success) {
$xp = XML::XPath->new(ioref => $content );
my $nodeset = $xp->findnodes($xpath);
foreach my $node ($nodeset->get_nodelist){
print XML::XPath::XMLParser::as_string($node);
}
}
I get this output
[mstrullato@vm01 ~]$ perl ./query_was.pl
404 File `/wasPerfTool/dtd/performancemonitor.dtd' does not exist
file:///wasPerfTool/dtd/performancemonitor.dtd
Handler couldn't resolve external entity at line 8, column 160, byte
703
error in processing external entity reference at line 8, column 160,
byte 703:
<!-- not published or otherwise divested of its trade secrets,
irrespective -->
<!-- of what has been deposited with the U.S. Copyright
Office. -->
<!--
****************************************************************************--
performancemonitor.dtd"><!DOCTYPE PerformanceMonitor SYSTEM "/wasPerfTool/dtd/
===============================================================================================================================================================^
<PerformanceMonitor responseStatus="success" version="6.1.0.13">
at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/XML/
Parser.pm line 187
I can see that the problem is the dtd document that is not found: the
code is looking to the dtd into filesystem and not from the correct
location...
Could you help me?
Hou should I change my code?
Thanks
Marco