1 package Catalyst::Plugin::ConfigLoader::XML;
\r
8 Catalyst::Plugin::ConfigLoader::XML - Load XML config files
\r
12 Loads XML files. Example:
\r
15 <name>TestApp</name>
\r
16 <component name="Controller::Foo">
\r
23 =head2 extensions( )
\r
25 return an array of valid extensions (C<xml>).
\r
33 =head2 load( $file )
\r
35 Attempts to load C<$file> as an XML file.
\r
43 require XML::Simple;
\r
44 XML::Simple->import;
\r
45 my $config = XMLin( $file, ForceArray => [ 'component' ] );
\r
47 my $components = delete $config->{ component };
\r
48 foreach my $element ( keys %$components ) {
\r
49 $config->{ $element } = $components->{ $element };
\r
59 =item * Brian Cassidy E<lt>bricas@cpan.orgE<gt>
\r
63 =head1 COPYRIGHT AND LICENSE
\r
65 Copyright 2006 by Brian Cassidy
\r
67 This library is free software; you can redistribute it and/or modify
\r
68 it under the same terms as Perl itself.
\r
76 =item * L<Catalyst::Plugin::ConfigLoader>
\r
78 =item * L<XML::Simple>
\r