On 30 Oct 2006 at 15:29, Also Sprach Robin Berjon: > > On Oct 30, 2006, at 15:06, [EMAIL PROTECTED] wrote: > > my $root = $out->input->getElementsByTagName('body')->get_node(1); > > > > But it doesn't return anything. his makes the server fall over with a > > plugin error, $root being undefined. > > If I change 'body' with 'div' (there are plenty of divs) it returns > > a value. > > Is there any chance that get_node(0) returns something? Have you > tried to dump the NodeList you get to see if it contains anything?
Well, the docs say that the node list starts from 1 not 0. But I have tried it :) The above code is used elsewhere, even the get_node(1) for a single unique node in my DOM. This works. It's the getelementsbytagname that's failing. When I try to get the body tag the node list is empty. Bizarrely enough, when I try with the "div" tag, of which there are several, the nodelist contains only the one Element object. John --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]