Thank you. I tried that. The returned output is again, as before, a syntax error:
error in xpath expression //OverallConnectionPoolStatus/FlowRater/Name
+/text() ar
ound text() at D:\Scripts\prun84\test3.pl line 27
at D:\Scripts\prun84\test3.pl line 8
at D:\Scripts\prun84\test3.pl line 8
You said it won't do much, but it shouldn't crash with an error if the expression will return nothing! I think there is a problem somehow with loading the XML::Twig::XPath module, somehow I believe I still using the XML::Twig engine. Can it be ?
Just to make sure I attach the full program:
use XML::Twig::XPath;
my $t = XML::Twig::XPath->new( twig_roots =>
{
'BalancerStatus/WebServer/OverallConnectionPoolStatus' =>
+\§ion,
#'BalancerStatus/WebServer/BalancerStatus/Server' => \&sec
+tion
});
$t->parsefile( 'localhost.xml');
#
sub section {
my ($t, $section) = @_;
my $a = $section->get_xpath( q{//OverallConnectionPoolStatus/FlowR
+ater/Name/text()} );
$t->purge;
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|