1use Test;
2BEGIN { plan tests => 5 }
3
4use XML::XPath;
5ok(1);
6
7my $xp = XML::XPath->new(ioref => *DATA);
8ok($xp);
9
10my @nodes;
11@nodes = $xp->findnodes('//Footnote');
12ok(@nodes, 1);
13
14my $footnote = $nodes[0];
15
16@nodes = $footnote->findnodes('ancestor::*');
17ok(@nodes, 3);
18
19@nodes = $footnote->findnodes('ancestor::text:footnote');
20ok(@nodes, 1);
21
22__DATA__
23<foo xmlns:text="http://example.com/text">
24<text:footnote text:id="ftn2">
25<text:footnote-citation>2</text:footnote-citation>
26<text:footnote-body>
27<Footnote style="font-size: 10pt; margin-left: 0.499cm;
28margin-right: 0cm; text-indent: -0.499cm; font-family: ; ">AxKit
29is very flexible in how it lets you transform the XML on the
30server, and there are many modules you can plug in to AxKit to
31allow you to do these transformations. For this reason, the AxKit
32installation does not mandate any particular modules to use,
33instead it will simply suggest modules that might help when you
34install AxKit.</Footnote>
35</text:footnote-body>
36</text:footnote>
37</foo>
38