line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Validator::Schema::TypeLibrary; |
2
|
6
|
|
|
6
|
|
25875
|
use strict; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
1587
|
|
3
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
219
|
|
4
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
807
|
use XML::Validator::Schema::Util qw(XSD _err); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
365
|
|
6
|
6
|
|
|
6
|
|
750
|
use XML::Validator::Schema::SimpleType; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
153
|
|
7
|
6
|
|
|
6
|
|
62
|
use base 'XML::Validator::Schema::Library'; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
3915
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
XML::Validator::Schema::TypeLibrary |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Internal module used to implement a library of types, simple and |
16
|
|
|
|
|
|
|
complex. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 USAGE |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# get a new type library, containing just the builtin types |
21
|
|
|
|
|
|
|
$library = XML::Validator::Schema::TypeLibrary->new(); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# add a new type |
24
|
|
|
|
|
|
|
$library->add(name => 'myString', |
25
|
|
|
|
|
|
|
ns => 'http://my/ns', |
26
|
|
|
|
|
|
|
obj => $type_obj); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# lookup a type |
29
|
|
|
|
|
|
|
my $type = $library->find(name => 'myString', |
30
|
|
|
|
|
|
|
ns => 'http://my/ns'); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
1
|
|
|
1
|
0
|
15
|
my $pkg = shift; |
36
|
1
|
|
|
|
|
17
|
my $self = $pkg->SUPER::new(what => 'type', @_); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# load builtin simple types into XSD namespace |
39
|
1
|
|
|
|
|
31
|
$self->{stacks}{XSD()} = { %XML::Validator::Schema::SimpleType::BUILTIN }; |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
|
|
5
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|