blob: 4bd9baad5bc785b569aa99c58e512c5596eaf5d6 (
plain)
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
27
28
29
30
|
use strict;
use warnings;
use utf8;
no warnings 'utf8';
use Test::More tests => 32;
use XML::LibXML;
use Biber;
chdir('t');
# Validate all .bcfs used in tests
# Set up schema
my $CFxmlschema = XML::LibXML::RelaxNG->new(location => '../data/schemata/bcf.rng');
foreach my $bcf (<tdata/*.bcf>) {
# Set up XML parser
my $CFxmlparser = XML::LibXML->new();
# basic parse and XInclude processing
my $CFxp = $CFxmlparser->parse_file($bcf);
# XPath context
my $CFxpc = XML::LibXML::XPathContext->new($CFxp);
$CFxpc->registerNs('bcf', 'https://sourceforge.net/projects/biblatex');
# Validate against schema. Dies if it fails.
$CFxmlschema->validate($CFxp);
is($@, '', "Validation of $bcf");
}
|