root/XML-Atom-0.22/lib/XML/Atom.pm

Revision 397, 1.6 kB (checked in by miya, 2 years ago)

--

Line 
1 # $Id$
2
3 package XML::Atom;
4 use strict;
5
6 BEGIN {
7     @XML::Atom::EXPORT = qw( LIBXML );
8     if (eval { require XML::LibXML }) {
9         *{XML::Atom::LIBXML} = sub() {1};
10     } else {
11         require XML::XPath;
12         *{XML::Atom::LIBXML} = sub() {0};
13     }
14     local $^W = 0;
15     *XML::XPath::Function::namespace_uri = sub {
16         my $self = shift;
17         my($node, @params) = @_;
18         my $ns = $node->getNamespace($node->getPrefix);
19         if (!$ns) {
20             $ns = ($node->getNamespaces)[0];
21         }
22         XML::XPath::Literal->new($ns ? $ns->getExpanded : '');
23     };
24
25     $XML::Atom::ForceUnicode = 0;
26     $XML::Atom::DefaultVersion = 0.3;
27 }
28
29 use base qw( XML::Atom::ErrorHandler Exporter );
30
31 our $VERSION = '0.22';
32
33 package XML::Atom::Namespace;
34 use strict;
35
36 sub new {
37     my $class = shift;
38     my($prefix, $uri) = @_;
39     bless { prefix => $prefix, uri => $uri }, $class;
40 }
41
42 sub DESTROY { }
43
44 use vars qw( $AUTOLOAD );
45 sub AUTOLOAD {
46     (my $var = $AUTOLOAD) =~ s!.+::!!;
47     no strict 'refs';
48     ($_[0], $var);
49 }
50
51 1;
52 __END__
53
54 =head1 NAME
55
56 XML::Atom - Atom feed and API implementation
57
58 =head1 SYNOPSIS
59
60     use XML::Atom;
61
62 =head1 DESCRIPTION
63
64 Atom is a syndication, API, and archiving format for weblogs and other
65 data. I<XML::Atom> implements the feed format as well as a client for the
66 API.
67
68 =head1 LICENSE
69
70 I<XML::Atom> is free software; you may redistribute it and/or modify it
71 under the same terms as Perl itself.
72
73 =head1 AUTHOR & COPYRIGHT
74
75 Except where otherwise noted, I<XML::Atom> is Copyright 2003-2005
76 Benjamin Trott, cpan@stupidfool.org. All rights reserved.
77
78 =head1 CO-MAINTAINER
79
80 Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt>
81
82 =cut
83
84
Note: See TracBrowser for help on using the browser.