init III
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package SOAP::Lite::Deserializer::XMLSchema1999;
|
||||
use strict;
|
||||
|
||||
use SOAP::Lite::Deserializer::XMLSchemaSOAP1_1;
|
||||
|
||||
sub anyTypeValue { 'ur-type' }
|
||||
|
||||
# use as_string and as_boolean from SOAP1_1 Deserializer
|
||||
|
||||
sub as_string; *as_string = \&SOAP::Lite::Deserializer::XMLSchemaSOAP1_1::as_string;
|
||||
sub as_boolean; *as_boolean = \&SOAP::Lite::Deserializer::XMLSchemaSOAP1_1::as_boolean;
|
||||
|
||||
sub as_hex {
|
||||
shift;
|
||||
my $value = shift;
|
||||
$value =~ s/([a-zA-Z0-9]{2})/chr oct '0x'.$1/ge;
|
||||
$value
|
||||
}
|
||||
|
||||
sub as_ur_type { $_[1] }
|
||||
|
||||
sub as_undef {
|
||||
shift;
|
||||
my $value = shift;
|
||||
$value eq '1' || $value eq 'true'
|
||||
? 1
|
||||
: $value eq '0' || $value eq 'false'
|
||||
? 0
|
||||
: die "Wrong null/nil value '$value'\n";
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
no strict 'refs';
|
||||
for my $method (qw(
|
||||
float double decimal timeDuration recurringDuration uriReference
|
||||
integer nonPositiveInteger negativeInteger long int short byte
|
||||
nonNegativeInteger unsignedLong unsignedInt unsignedShort unsignedByte
|
||||
positiveInteger timeInstant time timePeriod date month year century
|
||||
recurringDate recurringDay language
|
||||
)) {
|
||||
my $name = 'as_' . $method;
|
||||
*$name = sub { $_[1] };
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,31 @@
|
||||
package SOAP::Lite::Deserializer::XMLSchema2001;
|
||||
|
||||
use strict;
|
||||
use SOAP::Lite::Deserializer::XMLSchema1999;
|
||||
use SOAP::Lite::Deserializer::XMLSchemaSOAP1_1;
|
||||
use SOAP::Lite::Deserializer::XMLSchemaSOAP1_2;
|
||||
|
||||
sub anyTypeValue { 'anyType' }
|
||||
sub as_string; *as_string = \&SOAP::Lite::Deserializer::XMLSchema1999::as_string;
|
||||
sub as_anyURI; *as_anyURI = \&SOAP::Lite::Deserializer::XMLSchemaSOAP1_1::as_anyURI;
|
||||
sub as_boolean; *as_boolean = \&SOAP::Lite::Deserializer::XMLSchemaSOAP1_2::as_boolean;
|
||||
sub as_base64Binary; *as_base64Binary = \&SOAP::Lite::Deserializer::XMLSchemaSOAP1_2::as_base64;
|
||||
sub as_hexBinary; *as_hexBinary = \&SOAP::Lite::Deserializer::XMLSchema1999::as_hex;
|
||||
sub as_undef; *as_undef = \&SOAP::Lite::Deserializer::XMLSchema1999::as_undef;
|
||||
|
||||
BEGIN {
|
||||
no strict 'refs';
|
||||
for my $method (qw(
|
||||
anyType anySimpleType
|
||||
float double decimal dateTime timePeriod gMonth gYearMonth gYear
|
||||
century gMonthDay gDay duration recurringDuration
|
||||
language integer nonPositiveInteger negativeInteger long int short
|
||||
byte nonNegativeInteger unsignedLong unsignedInt unsignedShort
|
||||
unsignedByte positiveInteger date time QName
|
||||
)) {
|
||||
my $name = 'as_' . $method;
|
||||
*$name = sub { $_[1] }
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,33 @@
|
||||
package SOAP::Lite::Deserializer::XMLSchemaSOAP1_1;
|
||||
use strict;
|
||||
|
||||
sub anyTypeValue { 'ur-type' }
|
||||
|
||||
sub as_boolean {
|
||||
shift;
|
||||
my $value = shift;
|
||||
$value eq '1' || $value eq 'true'
|
||||
? 1
|
||||
: $value eq '0' || $value eq 'false'
|
||||
? 0
|
||||
: die "Wrong boolean value '$value'\n"
|
||||
}
|
||||
|
||||
sub as_base64 { shift; require MIME::Base64; MIME::Base64::decode_base64(shift) }
|
||||
|
||||
sub as_ur_type { $_[1] }
|
||||
|
||||
sub as_anyURI { $_[1] }
|
||||
|
||||
BEGIN {
|
||||
no strict 'refs';
|
||||
for my $method (qw(
|
||||
string float double decimal timeDuration recurringDuration uriReference
|
||||
integer nonPositiveInteger negativeInteger long int short byte
|
||||
nonNegativeInteger unsignedLong unsignedInt unsignedShort unsignedByte
|
||||
positiveInteger timeInstant time timePeriod date month year century
|
||||
recurringDate recurringDay language
|
||||
)) { my $name = 'as_' . $method; *$name = sub { $_[1] } }
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -0,0 +1,25 @@
|
||||
package SOAP::Lite::Deserializer::XMLSchemaSOAP1_2;
|
||||
use strict;
|
||||
use SOAP::Lite::Deserializer::XMLSchemaSOAP1_1;
|
||||
|
||||
sub anyTypeValue { 'anyType' }
|
||||
|
||||
sub as_boolean; *as_boolean = \&SOAP::Lite::Deserializer::XMLSchemaSOAP1_1::as_boolean;
|
||||
sub as_base64 { shift; require MIME::Base64; MIME::Base64::decode_base64(shift) }
|
||||
|
||||
BEGIN {
|
||||
no strict 'refs';
|
||||
for my $method (qw(
|
||||
anyType
|
||||
string float double decimal dateTime timePeriod gMonth gYearMonth gYear
|
||||
century gMonthDay gDay duration recurringDuration anyURI
|
||||
language integer nonPositiveInteger negativeInteger long int short byte
|
||||
nonNegativeInteger unsignedLong unsignedInt unsignedShort unsignedByte
|
||||
positiveInteger date time
|
||||
)) {
|
||||
my $name = 'as_' . $method;
|
||||
*$name = sub { $_[1] };
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user