ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-XMPP2/lib/Net/XMPP2/Namespaces.pm
Revision: 1.3
Committed: Fri Feb 2 23:24:39 2007 UTC (19 years, 7 months ago) by elmex
Branch: MAIN
Changes since 1.2: +1 -0 lines
Log Message:
lots of changes. added roster retrival

File Contents

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