line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#============================================================= -*-perl-*- |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# XML::Schema::Type.pm |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# DESCRIPTION |
6
|
|
|
|
|
|
|
# Module implementing a base class for XML Schema datatypes. This |
7
|
|
|
|
|
|
|
# is the ur-type, instantiated within a schema as the ever-present |
8
|
|
|
|
|
|
|
# anyType. |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# AUTHOR |
11
|
|
|
|
|
|
|
# Andy Wardley |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# COPYRIGHT |
14
|
|
|
|
|
|
|
# Copyright (C) 2001 Canon Research Centre Europe Ltd. |
15
|
|
|
|
|
|
|
# All Rights Reserved. |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
# This module is free software; you can redistribute it and/or |
18
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
# REVISION |
21
|
|
|
|
|
|
|
# $Id: Type.pm,v 1.1.1.1 2001/08/29 14:30:17 abw Exp $ |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
#======================================================================== |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
package XML::Schema::Type; |
26
|
|
|
|
|
|
|
|
27
|
28
|
|
|
28
|
|
144
|
use strict; |
|
28
|
|
|
|
|
49
|
|
|
28
|
|
|
|
|
912
|
|
28
|
28
|
|
|
28
|
|
143
|
use XML::Schema::Base; |
|
28
|
|
|
|
|
69
|
|
|
28
|
|
|
|
|
666
|
|
29
|
28
|
|
|
28
|
|
18307
|
use XML::Schema::Type::Simple; |
|
28
|
|
|
|
|
85
|
|
|
28
|
|
|
|
|
1967
|
|
30
|
28
|
|
|
28
|
|
17075
|
use XML::Schema::Type::Complex; |
|
28
|
|
|
|
|
83
|
|
|
28
|
|
|
|
|
2830
|
|
31
|
|
|
|
|
|
|
|
32
|
28
|
|
|
28
|
|
255
|
use base qw( XML::Schema::Base ); |
|
28
|
|
|
|
|
52
|
|
|
28
|
|
|
|
|
15568
|
|
33
|
28
|
|
|
28
|
|
165
|
use vars qw( $VERSION $DEBUG $ERROR @MANDATORY @OPTIONAL ); |
|
28
|
|
|
|
|
56
|
|
|
28
|
|
|
|
|
14349
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$VERSION = sprintf("%d.%02d", q$Revision: 1.1.1.1 $ =~ /(\d+)\.(\d+)/); |
36
|
|
|
|
|
|
|
$DEBUG = 0 unless defined $DEBUG; |
37
|
|
|
|
|
|
|
$ERROR = ''; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
@MANDATORY = qw( ); |
40
|
|
|
|
|
|
|
@OPTIONAL = qw( name namespace base ); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
44
|
|
|
|
|
|
|
# init() |
45
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub init { |
48
|
3
|
|
|
3
|
1
|
26
|
my ($self, $config) = @_; |
49
|
3
|
|
|
|
|
8
|
my ($name, $value); |
50
|
|
|
|
|
|
|
|
51
|
3
|
|
|
|
|
37
|
my ($mand, $option) |
52
|
3
|
|
|
|
|
6
|
= @{ $self->_baseargs( qw( @MANDATORY %OPTIONAL ) ) }; |
53
|
|
|
|
|
|
|
|
54
|
3
|
50
|
0
|
|
|
10
|
$self->_mandatory($mand, $config) |
55
|
|
|
|
|
|
|
|| return if @$mand; |
56
|
|
|
|
|
|
|
|
57
|
3
|
50
|
|
|
|
23
|
$self->_optional($option, $config) |
58
|
|
|
|
|
|
|
|| return; |
59
|
|
|
|
|
|
|
|
60
|
3
|
|
|
|
|
30
|
return $self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
65
|
|
|
|
|
|
|
# base() |
66
|
|
|
|
|
|
|
# |
67
|
|
|
|
|
|
|
# Returns the value of the 'base' item, denoting a base class type. |
68
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub base { |
71
|
1
|
|
|
1
|
0
|
4
|
my $self = shift; |
72
|
1
|
|
|
|
|
7
|
return $self->{ base }; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
77
|
|
|
|
|
|
|
# name() |
78
|
|
|
|
|
|
|
# |
79
|
|
|
|
|
|
|
# Returns the type name. |
80
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub name { |
83
|
46
|
|
|
46
|
0
|
133
|
my $self = shift; |
84
|
46
|
|
|
|
|
305
|
return $self->{ name }; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
89
|
|
|
|
|
|
|
# namespace() |
90
|
|
|
|
|
|
|
# |
91
|
|
|
|
|
|
|
# Returns the type namespace. |
92
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub namespace { |
95
|
1
|
|
|
1
|
0
|
2
|
my $self = shift; |
96
|
1
|
|
|
|
|
7
|
return $self->{ namespace }; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
1; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
__END__ |