I use the following xml:
<?xml version="1.0"?>
<me>
<name>Joe Cool </name>
<age>24</age>
<sex>male</sex>
</me>
my Ques.
Why when I use the following code I get 7 and not 3 , if it is a recursive command , why 7 and not 6 ???
print $children->getLength;
The full script :
#!/usr/bin/perl
use XML:
OM;
$xp = new XML:
OM:
arser();
$doc = $xp->parsefile("in.xml");
$root = $doc->getDocumentElement();
my $children = $root->getChildNodes();
print $children->getLength;
<?xml version="1.0"?>
<me>
<name>Joe Cool </name>
<age>24</age>
<sex>male</sex>
</me>
my Ques.
Why when I use the following code I get 7 and not 3 , if it is a recursive command , why 7 and not 6 ???
print $children->getLength;
The full script :
#!/usr/bin/perl
use XML:
$xp = new XML:
$doc = $xp->parsefile("in.xml");
$root = $doc->getDocumentElement();
my $children = $root->getChildNodes();
print $children->getLength;