Subject: | Context position of non-existent elements in XPATH expressions |
Date: | Wed, 18 Jan 2006 20:11:09 -0800 |
To: | bug-XML-Twig [...] rt.cpan.org |
From: | Dan Dascalescu <ddascalescu [...] gmail.com> |
#! perl -w
# Error on context position of non-existent elements in XPATH expressions:
# Can't call method "children" on an undefined value at (eval N) line 1
# Copyright (C) 2005 Dan Dascalescu <ddascalescu@gmail.com>
use strict;
use XML::Twig;
print "1..1\n";
my $twig= new XML::Twig()->parse("<root></root>");
$twig->get_xpath('//root/elt[1]/child');
print "ok 1\n";
exit 0;
Hope that helps,
Dan Dascalescu