| 1 | package SOAP::WSDL::XSD::Builtin; | ||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use Class::Std::Fast::Storable; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 2 | ▶ | use base qw(SOAP::WSDL::Base); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 2 | our $VERSION = 3.004; | |||||||||||
| 8 | |||||||||||||
| 9 | # only used in SOAP::WSDL - will be obsolete once SOAP::WSDL uses the | ||||||||||||
| 10 | # generative approach, too | ||||||||||||
| 11 | |||||||||||||
| 12 | 1 | ▶ | sub serialize { | ||||||||||
|
Subroutine
serialize: called CC=8 SCAR=27.7
Pod
undocumented
| |||||||||||||
| 13 | 1 | my ($self, $name, $value, $opt) = @_; | |||||||||||
| 14 | 1 | my $xml; | |||||||||||
| 15 | 1 | ▶ | $opt->{ indent } ||= ""; | ||||||||||
|
Condition50%1/2
$opt->{"indent"} ||= ""
MC/DC0%0/1
$opt->{"indent"} ||= ""
$opt->{"indent"}
Truth table50%1/2
A
A= $opt->{"indent"}
| |||||||||||||
| 16 | 1 | ▶ | $opt->{ attributes } ||= []; | ||||||||||
|
Condition50%1/2
$opt->{"attributes"} ||= []
MC/DC0%0/1
$opt->{"attributes"} ||= []
$opt->{"attributes"}
Truth table50%1/2
A
A= $opt->{"attributes"}
| |||||||||||||
| 17 | |||||||||||||
| 18 | 1 | ▶ | $xml .= $opt->{ indent } if ($opt->{ readable }); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 19 | 1 | $xml .= '<' . join ' ', $name, @{ $opt->{ attributes } }; | |||||||||||
| 20 | 1 | ▶ | if ( $opt->{ autotype }) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 1 | my $ns = $self->get_targetNamespace(); | |||||||||||
| 22 | 1 | my %prefix_of = reverse %{ $opt->{ namespace } }; | |||||||||||
| 23 | 1 | ▶ | my $prefix = $prefix_of{ $ns } | ||||||||||
|
Condition50%1/2
$prefix_of{$ns} || die('No prefix found for namespace ' . $ns)
MC/DC0%0/1
$prefix_of{$ns} || die('No prefix found for namespace ' . $ns)
$prefix_of{$ns}
Truth table50%1/2
A
A= $prefix_of{$ns}
| |||||||||||||
| 24 | || die 'No prefix found for namespace '. $ns; | ||||||||||||
| 25 | 0 | $xml .= ' type="' . $prefix . ':' | |||||||||||
| 26 | . $self->get_name() . '"'; | ||||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 0 | ▶ | if (defined $value) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 0 | $xml .= '>'; | |||||||||||
| 31 | 0 | $xml .= "$value"; | |||||||||||
| 32 | 0 | $xml .= '</' . $name . '>' ; | |||||||||||
| 33 | } | ||||||||||||
| 34 | else { | ||||||||||||
| 35 | 0 | $xml .= '/>'; | |||||||||||
| 36 | } | ||||||||||||
| 37 | 0 | ▶ | $xml .= "\n" if ($opt->{ readable }); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 38 | 0 | return $xml; | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | 2 | 1; | |||||||||||