ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Net-XMPP2/lib/Net/XMPP2/Namespaces.pm
Revision: 1.2
Committed: Tue Jan 23 22:36:11 2007 UTC (19 years, 8 months ago) by elmex
Branch: MAIN
Changes since 1.1: +2 -0 lines
Log Message:
implemented TLS!

File Contents

# Content
1 package Net::XMPP2::Namespaces;
2 use warnings;
3 use strict;
4 require Exporter;
5 our @EXPORT_OK = qw/xmpp_ns set_xmpp_ns_alias/;
6 our @ISA = qw/Exporter/;
7
8 our %NAMESPACES = (
9 client => 'jabber:client',
10 stream => 'http://etherx.jabber.org/streams',
11 streams => 'urn:ietf:params:xml:ns:xmpp-streams',
12 stanzas => 'urn:ietf:params:xml:ns:xmpp-stanzas',
13 sasl => 'urn:ietf:params:xml:ns:xmpp-sasl',
14 bind => 'urn:ietf:params:xml:ns:xmpp-bind',
15 tls => 'urn:ietf:params:xml:ns:xmpp-tls',
16 roster => 'jabber:iq:roster',
17 version => 'jabber:iq:version',
18 session => 'urn:ietf:params:xml:ns:xmpp-session',
19 xml => 'http://www.w3.org/XML/1998/namespace',
20 );
21
22 =head1 NAME
23
24 Net::XMPP2::Namespaces - A XMPP namespace collection and aliasing class
25
26 =head1 SYNOPSIS
27
28 use Net::XMPP2::Namespaces qw/xmpp_ns set_xmpp_ns_alias/;
29
30 set_xmpp_ns_alias (stanzas => 'urn:ietf:params:xml:ns:xmpp-stanzas');
31 $node->find_all ($p, [xmpp_ns ('stanzas'), 'iq']);
32
33 =head1 DESCRIPTION
34
35 This module represents a simple namespaces aliasing mechanism to ease handling
36 of namespaces when traversing Net::XMPP2::Node objects and writing XML
37 with Net::XMPP2::Writer.
38
39 =head1 XMPP NAMESPACES
40
41 There are already some aliases defined for the XMPP XML namespaces
42 which make handling of namepsaces a bit easier:
43
44 stream => http://etherx.jabber.org/streams
45 xml => http://www.w3.org/XML/1998/namespace
46
47 streams => urn:ietf:params:xml:ns:xmpp-streams
48 session => urn:ietf:params:xml:ns:xmpp-session
49 stanzas => urn:ietf:params:xml:ns:xmpp-stanzas
50 sasl => urn:ietf:params:xml:ns:xmpp-sasl
51 bind => urn:ietf:params:xml:ns:xmpp-bind
52 tls => urn:ietf:params:xml:ns:xmpp-tls
53
54 client => jabber:client
55 roster => jabber:iq:roster
56 version => jabber:iq:version
57
58 =head1 FUNCTIONS
59
60 =head2 xmpp_ns ($alias)
61
62 Returns am uri for the registered C<$alias> or undef if none exists.
63
64 =cut
65
66 sub xmpp_ns { return $NAMESPACES{$_[0]} }
67
68 =head2 set_xmpp_ns_alias ($alias, $namespace_uri)
69
70 Sets an C<$alias> for the C<$namespace_uri>.
71
72 =cut
73
74 sub set_xmpp_ns_alias { return $NAMESPACES{$_[0]} }
75
76 =head1 AUTHOR
77
78 Robin Redeker, C<< <elmex at ta-sa.org> >>
79
80 =head1 BUGS
81
82 Please report any bugs or feature requests to
83 C<bug-net-xmpp2 at rt.cpan.org>, or through the web interface at
84 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-XMPP2>.
85 I will be notified, and then you'll automatically be notified of progress on
86 your bug as I make changes.
87
88 =head1 SUPPORT
89
90 You can find documentation for this module with the perldoc command.
91
92 perldoc Net::XMPP2
93
94 You can also look for information at:
95
96 =over 4
97
98 =item * AnnoCPAN: Annotated CPAN documentation
99
100 L<http://annocpan.org/dist/Net-XMPP2>
101
102 =item * CPAN Ratings
103
104 L<http://cpanratings.perl.org/d/Net-XMPP2>
105
106 =item * RT: CPAN's request tracker
107
108 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-XMPP2>
109
110 =item * Search CPAN
111
112 L<http://search.cpan.org/dist/Net-XMPP2>
113
114 =back
115
116 =head1 ACKNOWLEDGEMENTS
117
118 =head1 COPYRIGHT & LICENSE
119
120 Copyright 2007 Robin Redeker, all rights reserved.
121
122 This program is free software; you can redistribute it and/or modify it
123 under the same terms as Perl itself.
124
125 =cut
126
127 1; # End of Net::XMPP2