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