AnyEven...espaces(3)

๐Ÿ’… AnyEven...espaces(3) โ€” like, the whole manual, bestie

Ok so real talk: this is the AnyEvent::XMPP::Namespaces page from the User Contributed Perl Documentation (that's the manual name, clocked it for you ๐Ÿซถ). It's short, it's sweet, and it's genuinely gonna save you so much pain. Let's go โœจ


๐ŸŒˆ NAME

AnyEvent::XMPP::Namespaces โ€” the XMPP namespace collection and aliasing class. That's it, that's the whole vibe: it collects namespaces and it aliases them. Iconic, honestly.


๐ŸŽ€ SYNOPSIS

use AnyEvent::XMPP::Namespaces qw/xmpp_ns set_xmpp_ns_alias/;

set_xmpp_ns_alias (stanzas => 'urn:ietf:params:xml:ns:xmpp-stanzas');

Literally two lines and you're already doing namespace wizardry. Slay.


๐Ÿ’– DESCRIPTION

So this module is a simple namespaces aliasing mechanism. That's its whole job, no cap. It exists so you don't have to suffer when you're:

  • traversing AnyEvent::XMPP::Node objects ๐Ÿ˜ฎโ€๐Ÿ’จ
  • writing XML with AnyEvent::XMPP::Writer ๐Ÿ–Š๏ธ

Basically: long ugly namespace URIs in, short cute nicknames out. Your future self says thank you ๐Ÿ’œ


๐Ÿฆ‹ XMPP NAMESPACES

Good news bestie โ€” some aliases are already defined for the XMPP XML namespaces, which makes handling of namepsaces a bit easier (their spelling, not mine ๐Ÿ’€). Here's the whole list, verbatim, because we respect the data:

stream  => http://etherx.jabber.org/streams
xml     => http://www.w3.org/XML/1998/namespace

streams => urn:ietf:params:xml:ns:xmpp-streams
session => urn:ietf:params:xml:ns:xmpp-session
stanzas => urn:ietf:params:xml:ns:xmpp-stanzas
sasl    => urn:ietf:params:xml:ns:xmpp-sasl
bind    => urn:ietf:params:xml:ns:xmpp-bind
tls     => urn:ietf:params:xml:ns:xmpp-tls

client  => jabber:client
roster  => jabber:iq:roster
version => jabber:iq:version
auth    => jabber:iq:auth

iq_oob  => jabber:iq:oob
x_oob   => jabber:x:oob

disco_info  => http://jabber.org/protocol/disco#info
disco_items => http://jabber.org/protocol/disco#items

register    => http://jabber.org/features/iq-register
iqauth      => http://jabber.org/features/iq-auth
data_form   => jabber:x:data

ping        => urn:xmpp:ping

vcard       => vcard-temp

pubsub      => http://jabber.org/protocol/pubsub
pubsub_own  => http://jabber.org/protocol/pubsub#owner
pubsub_ev   => http://jabber.org/protocol/pubsub#event

Twenty-four aliases, all pre-loaded, no setup required. We love a zero-effort win ๐ŸŒธ


๐Ÿ”ฅ FUNCTIONS

Three functions. Three. That's the whole API and it's giving minimalist queen energy ๐Ÿ‘‘

โญ xmpp_ns ($alias)

Returns am uri for the registered $alias โ€” or undef if none exists. ("am uri" is what the original says and I'm not gonna gaslight you by pretending otherwise ๐Ÿ˜ญ). So: registered alias in, URI out. Not registered? You get undef, respectfully.

โญ xmpp_ns_maybe ($alias_or_namespace_uri)

This one's the chill one. It tries to find whether there's an alias registered under $alias_or_namespace_uri, and if there isn't, it just hands you back $alias_or_namespace_uri unchanged. No dying, no drama โ€” it's giving "come as you are" ๐Ÿซถ

โญ set_xmpp_ns_alias ($alias, $namespace_uri)

Sets an $alias for the $namespace_uri. Two args, one assignment, infinite power ๐Ÿ’…


๐Ÿ‘‘ AUTHOR

Robin Redeker โ€” "<elmex at ta-sa.org>" โ€” JID: "<elmex at jabber.org>"

(Yes, both of those, exactly as written, one for email one for Jabber. Respect the multitasking ๐Ÿ’œ)


Copyright 2007, 2008 Robin Redeker, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Fun little legal moment, bestie: "all rights reserved" and "free software" in the same breath โ€” that's just how Perl licensing rolls, don't overthink it ๐Ÿ“

aaaand that's the whole page, no skips, no cuts, every alias accounted for. Signing off with the source deets: this was perl v5.42.2, dated 2026-02-15, page AnyEven...espaces(3). Go forth and alias responsibly, bestie โ€” you're gonna eat ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from