listify all XSD type objects when called as @{}
Status: Beta
Brought to you by:
kutterma
It would be very useful to be able to write the following idiom (safely):
for (@{$complexType->get_element}) {
}
This is especially useful when called from other "languages" like HTML::Template::Compiled, where you cannot do something like
$result = [ $result ] if ref $result ne 'ARRAY';
for (@{ $result })
Logged In: YES
user_id=884175
Originator: NO
The easiest way to fulfill this would be adding an :ARRAIFY method to SOAP::WSDL::XSD::Typelib::Builtin::anyType. This would result in the following behaviour:
Calling $complexType->get_element
- get_element is a list ref:
all fine, nothing triggered
- get_element is an object:
arraify triggered, should return [ $self ]
- get_element is undef:
remains undef.
So you have to write something like this in HTC:
<%IF_DEFINED complexType.get_element %>
<%LOOP complexType.get_element %>
Logged In: YES
user_id=884175
Originator: NO
Fixed in rev353 in SVN.