1 package Config::Any::XML;
\r
8 Config::Any::XML - Load XML config files
\r
12 Loads XML files. Example:
\r
15 <name>TestApp</name>
\r
16 <component name="Controller::Foo">
\r
26 =head2 extensions( )
\r
28 return an array of valid extensions (C<xml>).
\r
36 =head2 load( $file )
\r
38 Attempts to load C<$file> as an XML file.
\r
46 require XML::Simple;
\r
47 XML::Simple->import;
\r
48 my $config = XMLin(
\r
50 ForceArray => [ qw( component model view controller ) ],
\r
53 return $class->_coerce($config);
\r
57 # coerce the XML-parsed config into the correct format
\r
61 for my $k (keys %$config) {
\r
62 my $ref = $config->{$k};
\r
63 my $name = ref $ref ? delete $ref->{name} : undef;
\r
64 if (defined $name) {
\r
65 $out->{$k}->{$name} = $ref;
\r
77 =item * Brian Cassidy E<lt>bricas@cpan.orgE<gt>
\r
79 =item * Joel Bernstein E<lt>rataxis@cpan.orgE<gt>
\r
83 =head1 COPYRIGHT AND LICENSE
\r
85 Copyright 2006 by Brian Cassidy
\r
87 This library is free software; you can redistribute it and/or modify
\r
88 it under the same terms as Perl itself.
\r
96 =item * L<Config::Any>
\r
98 =item * L<XML::Simple>
\r