File: 51elementname.t

package info (click to toggle)
libxml-xpath-perl 1.48-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 608 kB
  • sloc: perl: 4,444; xml: 34; makefile: 10
file content (26 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl

use utf8;
use open qw(:std :encoding(utf-8));
use Test::More tests => 3;
use strict;
use warnings;
use XML::XPath;

my $good_path = '/employees/employee[@age="30"]/yağcı';
my $bad_path  = '/employees/employee[@age="30"]/şımarık';

my $xp = XML::XPath->new(ioref => \*DATA);

ok($xp);
ok($xp->findvalue($good_path), 'değil');
ok($xp->findvalue($bad_path), 'değil');

__DATA__
<?xml version="1.0" encoding="utf-8" ?>
<employees>
    <employee age="30">
        <şımarık>değil</şımarık>
        <yağcı>değil</yağcı>
    </employee>
</employees>