Solution:
Open "device.pm" this is in the JUNOS directory, which might be in /perl/site/lib/ or wherever you put it...
find this chunk of code
#########
for (my $i = 0; $i < $children->getLength(); $i++) {
$mynode = $children->item( $i );
if ($mynode->getNodeType == XML::DOM::TEXT_NODE) {
next; # Really not an element, try next
} elsif ($mynode->getNodeType() == XML::DOM::ELEMENT_NODE){
last; # Found the First element, exit the loop
}
}
#########
and modify as such:
#########
my $junosns = $self->{"xmlns:junos"};
for (my $i = 0; $i < $children->getLength(); $i++) {
$mynode = $children->item( $i );
if ($mynode->getNodeType == XML::DOM::TEXT_NODE) {
next; # Really not an element, try next
} elsif ($mynode->getNodeType() == XML::DOM::ELEMENT_NODE){
$mynode->setAttribute("xmlns:junos",$junosns);
last; # Found the First element, exit the loop
}
}
#########
This will make the error go away. Basically the junos namespace is declared in the <rpc-reply> tag, and this is essentially stripped off in the closeReply() method in "device.pm" Fortunately, the creaters of the perl API create a variable (actually its a key in a hash) called "xmlns:junos" in the device object
when it is passed to the start() method in parser.pm...
The object is not passed directly to the start method in parser.pm, it is actually passed to XML::Parser with a "style" key set to "JUNOS::DOM::Parser" which ultimately leads to the start() method in parser.pm being called...