1 package Config::Any::XML;
8 Config::Any::XML - Load XML config files
12 Loads XML files. Example:
16 <component name="Controller::Foo">
28 return an array of valid extensions (C<xml>).
38 Attempts to load C<$file> as an XML file.
45 my $args = shift || {};
48 my $config = XML::Simple::XMLin(
50 ForceArray => [ qw( component model view controller ) ],
54 return $class->_coerce( $config );
59 # coerce the XML-parsed config into the correct format
63 for my $k ( keys %$config ) {
64 my $ref = $config->{ $k };
65 my $name = ref $ref ? delete $ref->{ name } : undef;
66 if ( defined $name ) {
67 $out->{ $k }->{ $name } = $ref;
76 =head2 is_supported( )
78 Returns true if L<XML::Simple> is available.
83 eval { require XML::Simple; };
89 Brian Cassidy E<lt>bricas@cpan.orgE<gt>
91 Joel Bernstein E<lt>rataxis@cpan.orgE<gt>
93 =head1 COPYRIGHT AND LICENSE
95 Copyright 2007 by Brian Cassidy
97 This library is free software; you can redistribute it and/or modify
98 it under the same terms as Perl itself.
106 =item * L<Config::Any>
108 =item * L<XML::Simple>