Newer
Older
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Before `make install' is performed this script should be runnable
# with `make test'. After `make install' it should work as `perl
# DOMConfig.t'
######################### Begin module loading
# use blib;
use Test::More tests => 20;
BEGIN{use_ok('XML::Xerces')};
use lib 't';
use TestUtils qw($PERSONAL_FILE_NAME);
use vars qw($error);
use strict;
######################### Begin Test
my $document = q[<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<contributors>
<person Role="manager">
<name>Mike Pogue</name>
<email>mpogue@us.ibm.com</email>
</person>
<person Role="developer">
<name>Tom Watson</name>
<email>rtwatson@us.ibm.com</email>
</person>
<person Role="tech writer">
<name>Susan Hardenbrook</name>
<email>susanhar@us.ibm.com</email>
</person>
</contributors>];
my $impl = XML::Xerces::DOMImplementationRegistry::getDOMImplementation('LS');
my $DOM = $impl->createLSParser($XML::Xerces::DOMImplementationLS::MODE_SYNCHRONOUS,'');
my $conf = $DOM->getDomConfig();
isa_ok($conf, 'XML::Xerces::DOMConfiguration');
my @param_names = ($XML::Xerces::XMLUni::fgDOMErrorHandler,
$XML::Xerces::XMLUni::fgDOMSchemaType,
$XML::Xerces::XMLUni::fgDOMSchemaLocation,
$XML::Xerces::XMLUni::fgDOMCanonicalForm,
$XML::Xerces::XMLUni::fgDOMCDATASections,
$XML::Xerces::XMLUni::fgDOMComments,
$XML::Xerces::XMLUni::fgDOMDatatypeNormalization,
$XML::Xerces::XMLUni::fgDOMWRTDiscardDefaultContent,
$XML::Xerces::XMLUni::fgDOMEntities,
$XML::Xerces::XMLUni::fgDOMInfoset,
$XML::Xerces::XMLUni::fgDOMNamespaces,
$XML::Xerces::XMLUni::fgDOMNamespaceDeclarations,
$XML::Xerces::XMLUni::fgDOMNormalizeCharacters,
$XML::Xerces::XMLUni::fgDOMSplitCDATASections,
$XML::Xerces::XMLUni::fgDOMValidate,
$XML::Xerces::XMLUni::fgDOMValidateIfSchema,
$XML::Xerces::XMLUni::fgDOMElementContentWhitespace);
my @accepted_param_names = $conf->getParameterNames();
ok(scalar @accepted_param_names, "got parameter name list");
my %param_names = map {$_=>1} @param_names;
foreach my $param_name (@param_names) {
ok(exists $param_names{$param_name}, "can set $param_name");
}
my $handler = XML::Xerces::PerlErrorHandler->new();