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; };
91 If, by some chance, L<XML::Simple> has already been loaded with the strict
92 flag turned on, then you will likely get errors as warnings will become
93 fatal exceptions and certain arguments to XMLin() will no longer be optional.
95 See L<XML::Simple's strict mode documentation|XML::Simple/STRICT_MODE> for
100 Brian Cassidy E<lt>bricas@cpan.orgE<gt>
102 Joel Bernstein E<lt>rataxis@cpan.orgE<gt>
104 =head1 COPYRIGHT AND LICENSE
106 Copyright 2007 by Brian Cassidy
108 This library is free software; you can redistribute it and/or modify
109 it under the same terms as Perl itself.
117 =item * L<Config::Any>
119 =item * L<XML::Simple>