0

hi anybody please help me to get the value of isDone from following xml using linux command

<content type="text/xml">
<s:dict>
<s:key name="cursorTime">1969-12-31T19:00:00.000-05:00</s:key>
<s:key name="delegate"></s:key>
<s:key name="diskUsage">90112</s:key>
<s:key name="isDone">1</s:key>
</s:key>
</s:dict>
</content>
thamizhinian
  • 83
  • 1
  • 11

1 Answers1

0

I know it's not quite what you asked, but since Perl is generally installed by default:

#!/usr/bin/perl

use strict;
use warnings;

use XML::Twig;

my $twig = XML::Twig->new();
$twig->parsefile ( 'your_xml' );
print $twig->get_xpath ( './s:dict/s:key[@name="isDone"]', 0 ) -> text;
Sobrique
  • 52,974
  • 7
  • 60
  • 101