summaryrefslogtreecommitdiff
path: root/t/08name.t
diff options
context:
space:
mode:
Diffstat (limited to 't/08name.t')
-rw-r--r--t/08name.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/08name.t b/t/08name.t
new file mode 100644
index 0000000..15eb7fb
--- /dev/null
+++ b/t/08name.t
@@ -0,0 +1,25 @@
+use Test;
+BEGIN { plan tests => 5 }
+
+use XML::XPath;
+ok(1);
+
+my $xp = XML::XPath->new(ioref => *DATA);
+ok($xp);
+
+my @nodes;
+@nodes = $xp->findnodes('//*[name() = "BBB"]');
+ok(@nodes, 5);
+
+@nodes = $xp->findnodes('//*[starts-with(name(), "B")]');
+ok(@nodes, 7);
+
+@nodes = $xp->findnodes('//*[contains(name(), "C")]');
+ok(@nodes, 3);
+
+__DATA__
+<AAA>
+<BCC><BBB/><BBB/><BBB/></BCC>
+<DDB><BBB/><BBB/></DDB>
+<BEC><CCC/><DBD/></BEC>
+</AAA>