git-cpan-module: SOAP-WSDL git-cpan-version: 2.00.01 git-cpan-authorid: MKUTTER git-cpan-file: authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00.01.tar.gz
95 lines
2.2 KiB
Plaintext
95 lines
2.2 KiB
Plaintext
[% USE XSD(context) %]
|
|
package [% XSD.create_xsd_name(element) %];
|
|
use strict;
|
|
use warnings;
|
|
|
|
{ # BLOCK to scope variables
|
|
|
|
sub get_xmlns { '[% element.get_targetNamespace %]' }
|
|
|
|
__PACKAGE__->__set_name('[% element.get_name %]');
|
|
__PACKAGE__->__set_nillable([% IF (element.get_nillable);
|
|
IF (element.get_nillable != 'false'); %]1[% ELSE %]0[% END;
|
|
END;
|
|
%]);
|
|
__PACKAGE__->__set_minOccurs([% element.get_minOccurs %]);
|
|
__PACKAGE__->__set_maxOccurs([% element.get_maxOccurs %]);
|
|
__PACKAGE__->__set_ref([% IF element.get_ref; %]'[% element.get_ref %]'[% END %]);
|
|
|
|
[%- IF (type_name = element.get_type); -%]
|
|
use base qw(
|
|
SOAP::WSDL::XSD::Typelib::Element
|
|
[% type = definitions.get_types.0.find_type(element.expand(type_name));
|
|
XSD.create_xsd_name(type) %]
|
|
);
|
|
|
|
}
|
|
[%- ELSIF (ref = element.get_ref);
|
|
ref_from = ref.split(':');
|
|
-%]
|
|
# element ref="[% ref %]"
|
|
use base qw(
|
|
[% ref_element = definitions.get_types.0.find_element(element.expand(ref));
|
|
XSD.create_xsd_name( ref_element ); %]
|
|
);
|
|
|
|
}
|
|
[%- ELSIF (simpleType = element.first_simpleType) %]
|
|
# atomic simpleType: <element><simpleType
|
|
use base qw(
|
|
SOAP::WSDL::XSD::Typelib::Element
|
|
);
|
|
[% INCLUDE simpleType/contentModel.tt -%]
|
|
|
|
}
|
|
|
|
[% ELSIF (complexType = element.first_complexType) %]
|
|
use base qw(
|
|
SOAP::WSDL::XSD::Typelib::Element
|
|
SOAP::WSDL::XSD::Typelib::ComplexType
|
|
);
|
|
|
|
[% INCLUDE complexType/contentModel.tt -%]
|
|
|
|
} # end of BLOCK
|
|
|
|
[% END %]
|
|
|
|
1;
|
|
|
|
[%# work around for CPAN's indexer, which gets disturbed by pod in templates -%]
|
|
[% pod = BLOCK %]=pod[% END -%]
|
|
[% head1 = BLOCK %]=head1[% END -%]
|
|
[% head2 = BLOCK %]=head2[% END -%]
|
|
[% head3 = BLOCK %]=head3[% END -%]
|
|
|
|
[% pod %]
|
|
|
|
[% head1 %] NAME
|
|
|
|
[% XSD.create_xsd_name(element) %]
|
|
|
|
[% head1 %] DESCRIPTION
|
|
|
|
Perl data type class for the XML Schema defined element
|
|
[% element.get_name %] from the namespace [% element.get_targetNamespace %].
|
|
|
|
[% INCLUDE POD/annotation.tt(node = element) %]
|
|
|
|
[% head1 %] METHODS
|
|
|
|
[% head2 %] new
|
|
|
|
my $element = [% XSD.create_xsd_name(element) %]->new($data);
|
|
|
|
Constructor. The following data structure may be passed to new():
|
|
|
|
[% indent = ' '; INCLUDE element/POD/structure.tt; %]
|
|
|
|
[% head1 %] AUTHOR
|
|
|
|
Generated by SOAP::WSDL
|
|
|
|
=cut
|
|
|