import SOAP-WSDL 2.00_33 from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  2.00_33
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_33.tar.gz
This commit is contained in:
Martin Kutter
2009-12-12 19:48:28 -08:00
committed by Michael G. Schwern
parent 51db446428
commit 0cbf981665
146 changed files with 3364 additions and 1280 deletions
+20
View File
@@ -0,0 +1,20 @@
package SOAP::WSDL::XSD::Annotation;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<enumeration value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %appinfo_of :ATTR(:name<appinfo> :default<()>);
# documentation provided by Base
1;
+7 -4
View File
@@ -19,14 +19,17 @@ our $VERSION=q{2.00_29};
# Content: (annotation?, (simpleType?))
#</attribute>
# id provided by Base
# name provided by Base
# annotation provided by Base
my %default_of :ATTR(:name<default> :default<()>);
my %fixed_of :ATTR(:name<fixed> :default<()>);
my %form_of :ATTR(:name<form> :default<()>);
# id provided by Base
# name provided by Base
my %form_of :ATTR(:name<form> :default<()>);
my %type_of :ATTR(:name<type> :default<()>);
my %use_of :ATTR(:name<use> :default<()>);
my %use_of :ATTR(:name<use> :default<()>);
my %ref_of :ATTR(:name<ref> :default<()>);
# may be defined as atomic simpleType
my %simpleType_of :ATTR(:name<simpleType> :default<()>);
+27
View File
@@ -0,0 +1,27 @@
package SOAP::WSDL::XSD::AttributeGroup;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_29};
#<attributeGroup
# id = ID
# name = NCName
# ref = QName
# {any attributes with non-schema namespace . . .}>
# Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?))
#</attributeGroup>
# id provided by Base
# name provided by Base
# annotation provided by Base
my %ref_of :ATTR(:name<ref> :default<()>);
# may be defined as atomic simpleType
my %attribute_of :ATTR(:name<attribute> :default<()>);
my %attributeGroup_of :ATTR(:name<attributeGroup> :default<()>);
1;
+15 -3
View File
@@ -6,16 +6,28 @@ use Class::Std::Fast::Storable;
use Scalar::Util qw(blessed);
use base qw/SOAP::WSDL::Base/;
our $VERSION=q{2.00_29};
our $VERSION=q{2.00_33};
my %length_of :ATTR(:name<length> :default<[]>);
my %minLength_of :ATTR(:name<minLength> :default<[]>);
my %maxLength_of :ATTR(:name<maxLength> :default<[]>);
my %pattern_of :ATTR(:name<pattern> :default<[]>);
my %enumeration_of :ATTR(:name<enumeration> :default<[]>);
my %whiteSpace_of :ATTR(:name<whiteSpace> :default<[]>);
my %totalDigits_of :ATTR(:name<totalDigits> :default<[]>);
my %fractionDigits_of :ATTR(:name<fractionDigits> :default<[]>);
my %minExclusive :ATTR(:name<minExclusive> :default<[]>);
my %minInclusive :ATTR(:name<minInclusive> :default<[]>);
my %maxExclusive :ATTR(:name<maxExclusive> :default<[]>);
my %maxInclusive :ATTR(:name<maxInclusive> :default<[]>);
my %annotation_of :ATTR(:name<annotation> :default<()>);
my %attribute_of :ATTR(:name<attribute> :default<()>);
my %element_of :ATTR(:name<element> :default<()>);
#my %flavor_of :ATTR(:name<flavor> :default<()>);
my %group_of :ATTR(:name<group> :default<()>);
my %variety_of :ATTR(:name<variety> :default<()>);
my %base_of :ATTR(:name<base> :default<()>);
my %itemType_of :ATTR(:name<itemType> :default<()>);
my %enumeration_of :ATTR(:name<enumeration> :default<()>);
my %abstract_of :ATTR(:name<abstract> :default<()>);
my %mixed_of :ATTR(:name<mixed> :default<()>); # default is false
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::Enumeration;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<enumeration value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::Pattern;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<pattern value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+38
View File
@@ -0,0 +1,38 @@
package SOAP::WSDL::XSD::Group;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<xs:group name="myModelGroup">
# <xs:sequence>
# <xs:element ref="someThing"/>
# . . .
# </xs:sequence>
#</xs:group>
#
#<xs:complexType name="trivial">
# <xs:group ref="myModelGroup"/>
# <xs:attribute .../>
#</xs:complexType>
#
#<xs:complexType name="moreSo">
# <xs:choice>
# <xs:element ref="anotherThing"/>
# <xs:group ref="myModelGroup"/>
# </xs:choice>
# <xs:attribute .../>
#</xs:complexType>
my %ref_of :ATTR(:name<ref> :default<()>);
my %maxOccurs_of :ATTR(:name<maxOccurs> :default<()>);
my %minOccurs_of :ATTR(:name<minOccurs> :default<()>);
my %annotation_of :ATTR(:name<annotation> :default<()>);
my %element_of :ATTR(:name<element> :default<()>);
my %group_of :ATTR(:name<group> :default<()>);
my %variety_of :ATTR(:name<variety> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::Length;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<minExclusive value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::MaxExclusive;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<minExclusive value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::MaxInclusive;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<minExclusive value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::MaxLength;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<maxLength value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::MinExclusive;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<minExclusive value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::MinInclusive;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<minExclusive value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::MinLength;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<minExclusive value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::Pattern;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<pattern value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+10 -8
View File
@@ -4,19 +4,21 @@ use warnings;
use Class::Std::Fast::Storable;
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_25};
our $VERSION=q{2.00_33};
# child elements
my %type_of :ATTR(:name<type> :default<[]>);
my %element_of :ATTR(:name<element> :default<[]>);
my %group_of :ATTR(:name<group> :default<[]>);
my %attributeGroup_of :ATTR(:name<attributeGroup> :default<[]>);
my %attribute_of :ATTR(:name<attribute> :default<[]>);
my %element_of :ATTR(:name<element> :default<[]>);
my %group_of :ATTR(:name<group> :default<[]>);
my %type_of :ATTR(:name<type> :default<[]>);
# attributes
my %attributeFormDefault_of :ATTR(:name<attributeFormDefault> :default<()>);
my %blockDefault_of :ATTR(:name<blockDefault> :default<()>);
my %elementFormDefault_of :ATTR(:name<elementFormDefault> :default<()>);
my %finalDefault_of :ATTR(:name<finalDefault> :default<()>);
my %version_of :ATTR(:name<version> :default<()>);
my %blockDefault_of :ATTR(:name<blockDefault> :default<()>);
my %elementFormDefault_of :ATTR(:name<elementFormDefault> :default<()>);
my %finalDefault_of :ATTR(:name<finalDefault> :default<()>);
my %version_of :ATTR(:name<version> :default<()>);
# id
# name
+43 -35
View File
@@ -8,40 +8,48 @@ use base qw(SOAP::WSDL::XSD::Schema);
# all builtin types - add validation (e.g. content restrictions) later...
my %BUILTINS = (
'string' => {},
'boolean' => {},
'decimal' => {},
'dateTime' => {},
'float' => {},
'double' => {},
'duration' => {},
'time' => {},
'date' => {},
'gYearMonth' => {},
'gYear' => {},
'gMonthDay' => {},
'gDay' => {},
'gMonth' => {},
'hexBinary' => {},
'base64Binary' => {},
'anyURI' => {},
'QName' => {},
'NOTATION' => {},
'integer' => {},
'anyURI' => {},
'boolean' => {},
'base64Binary' => {},
'byte' => {},
'date' => {},
'dateTime' => {},
'decimal' => {},
'double' => {},
'duration' => {},
'ENTITY' => {},
'float' => {},
'gDay' => {},
'gMonth' => {},
'gMonthDay' => {},
'gYearMonth' => {},
'gYear' => {},
'hexBinary' => {},
'ID' => {},
'IDREF' => {},
'IDREFS' => {},
'int' => {},
'integer' => {},
'language' => {},
'long' => {},
'negativeInteger' => {},
'nonPositiveInteger' => {},
'nonNegativeInteger' => {},
'positiveInteger' => {},
'negativeInteger' => {},
'long' => {},
'int' => {},
'unsignedInt' => {},
'short' => {},
'unsignedShort' => {},
'byte' => {},
'unsignedByte' => {},
'normalizedString' => {},
'token' => {},
'NMTOKEN' => {},
'normalizedString' => {},
'Name' => {},
'NCName' => {},
'NMTOKEN' => {},
'NOTATION' => {},
'positiveInteger' => {},
'QName' => {},
'short' => {},
'string' => {},
'time' => {},
'token' => {},
'unsignedByte' => {},
'unsignedInt' => {},
'unsignedLong' => {},
'unsignedShort' => {},
);
sub START {
@@ -88,10 +96,10 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
=head1 REPOSITORY INFORMATION
$Rev: 412 $
$Rev: 583 $
$LastChangedBy: kutterma $
$Id: Builtin.pm 412 2007-11-27 22:57:52Z kutterma $
$Id: Builtin.pm 583 2008-03-24 07:44:06Z kutterma $
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Schema/Builtin.pm $
=cut
+21 -6
View File
@@ -6,13 +6,27 @@ use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_25};
my %annotation_of :ATTR(:name<annotation> :default<()>);
my %base_of :ATTR(:name<base> :default<()>);
my %itemType_of :ATTR(:name<itemType> :default<()>);
# is set to simpleContent/complexContent
# my %content_model_of :ATTR(:name<contentModel> :default<()>);
my %length_of :ATTR(:name<length> :default<[]>);
my %minLength_of :ATTR(:name<minLength> :default<[]>);
my %maxLength_of :ATTR(:name<maxLength> :default<[]>);
my %pattern_of :ATTR(:name<pattern> :default<[]>);
my %enumeration_of :ATTR(:name<enumeration> :default<[]>);
my %whiteSpace_of :ATTR(:name<whiteSpace> :default<[]>);
my %totalDigits_of :ATTR(:name<totalDigits> :default<[]>);
my %fractionDigits_of :ATTR(:name<fractionDigits> :default<[]>);
my %minExclusive :ATTR(:name<minExclusive> :default<[]>);
my %minInclusive :ATTR(:name<minInclusive> :default<[]>);
my %maxExclusive :ATTR(:name<maxExclusive> :default<[]>);
my %maxInclusive :ATTR(:name<maxInclusive> :default<[]>);
# TODO rename flavor to content_model to be consistent with the XML Schema
my %fixed :ATTR(:name<fixed> :default<[]>);
my %annotation_of :ATTR(:name<annotation> :default<()>);
my %base_of :ATTR(:name<base> :default<()>);
my %itemType_of :ATTR(:name<itemType> :default<()>);
# TODO rename flavor to variety to be consistent with the XML Schema
# specs - though flavor is the cooler name..
# set to restriction|list|union|enumeration
my %flavor_of :ATTR(:name<flavor> :default<()>);
@@ -29,6 +43,7 @@ sub set_restriction {
my $self = shift;
my @attributes = @_;
$self->set_flavor( 'restriction' );
for (@attributes) {
next if (not $_->{ LocalName } eq 'base');
$self->set_base( $_->{ Value } );
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::TotalDigits;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<totalDigits value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;
+2 -2
View File
@@ -8,8 +8,8 @@ our $VERSION=q{2.00_29};
sub start_tag {
# my ($self, $opt, $value) = @_;
return q{} if (@_ < 3);
return qq{ $_[1]->{ name }="}
return q{} if (@_ < 3);
return qq{ $_[1]->{ name }="};
}
sub end_tag {
+1 -2
View File
@@ -7,8 +7,7 @@ our $VERSION=q{2.00_29};
sub serialize {
# we work on @_ for performance.
$_[1] ||= {}; # $option_ref
# $_[1] ||= {}; # $option_ref
return ${ $_[0]->_serialize({ attr => 1 }) };
}
+1 -1
View File
@@ -3,5 +3,5 @@ use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none', cache => 1;
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::token);
Class::Std::initialize();
1;
@@ -2,7 +2,10 @@ package SOAP::WSDL::XSD::Typelib::Builtin::NMTOKENS;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none', cache => 1;
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::list
SOAP::WSDL::XSD::Typelib::Builtin::NMTOKEN);
Class::Std::initialize();
1;
@@ -2,6 +2,7 @@ package SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none', cache => 1;
use SOAP::WSDL::XSD::Typelib::Builtin::anyType;
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
my %value_of :ATTR(:get<value> :init_arg<value> :default<()>);
@@ -13,6 +14,11 @@ our $___value = \%value_of;
# and we don't need to return the last value...
sub set_value { $value_of{ ${ $_[0] } } = $_[1] }
# Default attribute handling
# TODO add something for handling default attributes
sub attr {
}
# use $_[n] for speed.
# This is less readable, but notably faster.
#
@@ -23,8 +29,10 @@ sub set_value { $value_of{ ${ $_[0] } } = $_[1] }
# every little statement matters...
sub serialize {
no warnings qw(uninitialized);
$_[1]->{ nil } = 1 if not defined $value_of{ ${$_[0]} };
$_[1] ||= {};
if (not defined $value_of{ ${$_[0]} }) {
return $_[0]->start_tag({ %{ $_[1] }, nil => 1 }, undef);
}
return join q{}
, $_[0]->start_tag($_[1], $value_of{ ${$_[0]} })
, $value_of{ ${$_[0]} }
@@ -32,7 +40,7 @@ sub serialize {
}
sub as_string :STRINGIFY {
return $value_of { ${ $_[0] } };
return defined($value_of { ${ $_[0] } }) ? $value_of { ${ $_[0] } } : q{};
}
sub as_bool :BOOLIFY {
@@ -51,6 +59,6 @@ sub new {
return $self;
}
Class::Std::Fast::initialize(); # make :BOOLIFY overloading serializable
Class::Std::initialize(); # make :BOOLIFY overloading serializable
1;
+27 -5
View File
@@ -8,12 +8,34 @@ our $VERSION = q{2.00_29};
sub get_xmlns { 'http://www.w3.org/2001/XMLSchema' };
# use $_[1] for performance
#sub start_tag {
# return q{} if not $#_; # return if no second argument ($opt)
# if ($_[1]->{ name }) {
# return qq{ $_[1]->{name}="} if $_[1]->{ attr };
# return "<$_[1]->{name}/>" if $_[1]->{ empty };
# return "<$_[1]->{name}>";
# }
# return q{};
#}
sub start_tag {
return q{} if not $#_; # return if no second argument ($opt)
if ($_[1]->{ name }) {
return qq{ $_[1]->{name}="} if $_[1]->{ attr };
return "<$_[1]->{name}/>" if $_[1]->{ empty };
return "<$_[1]->{name}>";
my $ending = ($_[1]->{ empty }) ? '/>' : '>';
my @attr_from = ();
if ($_[1]->{ nil }) {
push @attr_from, q{ xsi:nil="true"};
$ending = '/>';
}
# if (delete $_[1]->{qualified}) {
# push @attr_from, q{ xmlns="} . $_[0]->get_xmlns() . q{"};
# }
push @attr_from, $_[0]->serialize_attr();
# do we need to check for name ? Element ref="" should have it's own
# start_tag. If we don't need to check, we can speed things up
return join q{}, "<$_[1]->{ name }" , @attr_from , $ending;
}
return q{};
}
@@ -21,7 +43,7 @@ sub start_tag {
# use $_[1] for performance
sub end_tag {
return $_[1] && defined $_[1]->{ name }
? $_[1]->{ attr }
? $_[1]->{ attr }
? q{"}
: "</$_[1]->{name}>"
: q{};
@@ -29,7 +51,7 @@ sub end_tag {
sub serialize_attr {};
sub serialize { q{} };
# sub serialize { q{} };
sub serialize_qualified :STRINGIFY {
return $_[0]->serialize( { qualified => 1 } );
@@ -39,7 +61,7 @@ sub as_list :ARRAYIFY {
return [ $_[0] ];
}
Class::Std::initialize(); # make :STRINGIFY overloading serializable
Class::Std::initialize(); # make :STRINGIFY overloading work
1;
+1 -1
View File
@@ -33,5 +33,5 @@ sub as_bool :BOOLIFY {
return $_[0]->get_value();
}
Class::Std::initialize;
Class::Std::initialize();
1;
+43 -21
View File
@@ -4,19 +4,23 @@ use strict;
use warnings;
use Carp;
use SOAP::WSDL::XSD::Typelib::Builtin;
use Scalar::Util qw(blessed refaddr);
use Scalar::Util qw(blessed);
require Class::Std::Fast::Storable;
use base qw(SOAP::WSDL::XSD::Typelib::Builtin::anyType);
our $VERSION = '2.00_31';
our $VERSION = '2.00_33';
my %ELEMENTS_FROM;
my %ATTRIBUTES_OF;
my %CLASSES_OF;
# XML Attribute handling
my %xml_attr_of :ATTR();
# don't you ever dare to use this !
our $___attributes_of_ref = \%ATTRIBUTES_OF;
our $___xml_attribute_of_ref = \%xml_attr_of;
# STORABLE_ methods for supporting Class::Std::Fast::Storable.
# We could also handle them via AUTOMETHOD,
@@ -39,28 +43,28 @@ sub AUTOMETHOD {
. "\n"
}
# Attribute handling
my %xml_attr_of :ATTR();
sub attr {
my $self = shift;
my $class = ref $self;
my $class = $self->__get_attr_class()
or return;
# disable strictness - in perl 5.10 %{ "$foo\::_bar" } triggers a
# symbolic reference error with strictness enabled
no strict qw(refs);
die "$class has no attributes" if not defined %{ "$class\::_ATTR::"};
# die "$class has no attributes" if not defined %{ "$class\::_ATTR::"};
if (@_) {
# setter
return $xml_attr_of{ $$self } = "$class\::_ATTR"->new(@_);
return $xml_attr_of{ $$self } = $class->new(@_);
}
return $xml_attr_of{ $$self } if exists $xml_attr_of{ $$self };
return $xml_attr_of{ $$self } = "$class\::_ATTR"->new();
return $xml_attr_of{ $$self } = $class->new();
}
sub serialize_attr {
return q{} if not $xml_attr_of{ ${ $_[0] } };
$_[0]->attr()->serialize();
return $xml_attr_of{ ${ $_[0] } }->serialize();
}
sub as_hash_ref {
@@ -118,7 +122,7 @@ sub _factory {
# it when the method was created.
my $is_list = $type->isa('SOAP::WSDL::XSD::Typelib::Builtin::list');
# The set_$name method below looks rather weird,
# The set_$name method below looks rather weird,
# but is optimized for performance.
#
# We could use sub calls for sure, but these are much slower. And
@@ -151,7 +155,11 @@ sub _factory {
# d) we should also die for non-blessed non-ARRAY/HASH references in
# lists but don't do yet - oh my !
*{ "$class\::set_$name" } = sub {
# keep in sync with Generator::Template::Plugin::XSD - maybe use
# function to allow substituting via symbol table...
my $method_name = $name;
$method_name =~s{[\.\-]}{_}xmsg;
*{ "$class\::set_$method_name" } = sub {
if (not $#_) {
delete $attribute_ref->{ ${ $_[0] } };
return;
@@ -173,7 +181,6 @@ sub _factory {
]
: $is_ref eq 'HASH'
? $type->new( $_[1] )
# neither ARRAY nor HASH - probably an object...
: ($is_ref eq $type) # of required type ? ->isa would be a better test...
? $_[1] # use it
@@ -184,7 +191,7 @@ sub _factory {
return;
};
*{ "$class\::add_$name" } = sub {
*{ "$class\::add_$method_name" } = sub {
warn "attempting to add empty value to " . ref $_[0]
if not defined $_[1];
@@ -221,8 +228,13 @@ sub _factory {
# and call set appropriate field in clase
map { ($ATTRIBUTES_OF{ $class }->{ $_ })
? do {
my $method = "set_$_";
$self->$method( $_[1]->{ $_ } ); # ( $args_of->{ $_ } );
my $method = "set_$_";
# keep in sync with Generator::Template::Plugin::XSD - maybe use
# function to allow substituting via symbol table...
$method =~s{[\.\-]}{_}xmsg;
$self->$method( $_[1]->{ $_ } ); # ( $args_of->{ $_ } );
}
: $_ =~ m{ \A # beginning of string
xmlns # xmlns
@@ -245,7 +257,7 @@ sub _factory {
# Triggers XML attribute serialization if the options hash ref contains
# a attr element with a true value.
*{ "$class\::_serialize" } = sub {
my $ident = ${ $_[0]};
my $ident = ${ $_[0] };
my $option_ref = $_[1];
# return concatenated return value of serialize call of all
# elements retrieved from get_elements expanding list refs.
@@ -261,13 +273,13 @@ sub _factory {
# serialize element elements with their own serializer
# but name them like they're named here.
if ( $_->isa( 'SOAP::WSDL::XSD::Typelib::Element' ) ) {
$_->serialize( { name => $name } );
$_->serialize({ name => $name });
}
# serialize complextype elments (of other types) with their
# serializer, but add element tags around.
else {
join q{}, $_->start_tag({ name => $name , %{ $option_ref } })
, $_->serialize()
, $_->serialize($option_ref)
, $_->end_tag({ name => $name , %{ $option_ref } });
}
} @{ $element }
@@ -277,9 +289,19 @@ sub _factory {
}
} (@{ $ELEMENTS_FROM{ $class } });
};
# put hidden complex serializer into class
# ... but not for AttributeSet classes
if ( ! $class->isa('SOAP::WSDL::XSD::Typelib::AttributeSet')) {
*{ "$class\::serialize" } = \&__serialize_complex;
};
}
sub serialize {
# just a fallback
sub __get_attr_class {};
# hidden complex serializer
sub __serialize_complex {
# we work on @_ for performance.
$_[1] ||= {}; # $option_ref
@@ -459,9 +481,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
=head1 REPOSITORY INFORMATION
$Rev: 524 $
$Rev: 583 $
$LastChangedBy: kutterma $
$Id: ComplexType.pm 524 2008-02-10 23:24:43Z kutterma $
$Id: ComplexType.pm 583 2008-03-24 07:44:06Z kutterma $
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/ComplexType.pm $
=cut
+4 -4
View File
@@ -51,7 +51,7 @@ sub start_tag {
push @attr_from, q{ xsi:nil="true"};
$ending = '/>';
}
if ($_[1]->{qualified}) {
if (delete $_[1]->{qualified}) {
push @attr_from, q{ xmlns="} . $_[0]->get_xmlns() . q{"};
}
push @attr_from, $_[0]->serialize_attr();
@@ -111,7 +111,7 @@ This example creates a class for this XML schema definition:
Now we create this XML schema definition type class:
<element name="MyElement2" ref="tns:MyElement"/>
package MyElement2;
use strict;
use Class::Std::Fast::Storable constructor => 'none';
@@ -175,9 +175,9 @@ Martin Kutter E<lt>martin.kutter fen-net.deE<gt>
=head1 REPOSITORY INFORMATION
$Rev: 498 $
$Rev: 564 $
$LastChangedBy: kutterma $
$Id: Element.pm 498 2008-01-20 22:47:18Z kutterma $
$Id: Element.pm 564 2008-02-23 13:31:39Z kutterma $
$HeadURL: http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $
=cut
+18
View File
@@ -0,0 +1,18 @@
package SOAP::WSDL::XSD::WhiteSpace;
use strict;
use warnings;
use Class::Std::Fast::Storable constructor => 'none';
use base qw(SOAP::WSDL::Base);
our $VERSION=q{2.00_33};
#<pattern value="">
# id provided by Base
# name provided by Base
# annotation provided by Base
# may be defined as atomic simpleType
my %value_of :ATTR(:name<value> :default<()>);
1;