1XML::Stream::Namespace(U3s)er Contributed Perl DocumentatXiMoLn::Stream::Namespace(3)
2
3
4
6 XML::Stream::Namespace - Object to make defining Namespaces easier in
7 XML::Stream.
8
10 XML::Stream::Namespace is a helper package to XML::Stream. It provides
11 a clean way of defining Namespaces for XML::Stream to use when
12 connecting.
13
15 This module allows you to set and read elements from an XML::Stream
16 Namespace.
17
19 SetNamespace("mynamespace");
20 SetXMLNS("http://www.mynamespace.com/xmlns");
21 SetAttributes(attrib1=>"value1",
22 attrib2=>"value2");
23
24 GetNamespace() returns "mynamespace"
25 GetXMLNS() returns "http://www.mynamespace.com/xmlns"
26 GetAttributes() returns a hash ( attrib1=>"value1",attrib2=>"value2")
27 GetStream() returns the following string:
28 "xmlns:mynamespace='http://www.nynamespace.com/xmlns'
29 mynamespace:attrib1='value1'
30 mynamespace:attrib2='value2'"
31
33 $myNamespace = XML::Stream::Namespace->new("mynamspace");
34 $myNamespace->SetXMLNS("http://www.mynamespace.org/xmlns");
35 $myNamespace->SetAttributes(foo=>"bar",
36 bob=>"vila");
37
38 $stream = XML::Stream->new;
39 $stream->Connect(name=>"foo.bar.org",
40 port=>1234,
41 namespace=>"foo:bar",
42 namespaces=>[ $myNamespace ]);
43
44 #
45 # The above Connect will send the following as the opening string
46 # of the stream to foo.bar.org:1234...
47 #
48 # <stream:stream
49 # xmlns:stream="http://etherx.jabber.org/streams"
50 # to="foo.bar.org"
51 # xmlns="foo:bar"
52 # xmlns:mynamespace="http://www.mynamespace.org/xmlns"
53 # mynamespace:foo="bar"
54 # mynamespace:bob="vila">
55 #
56
58 Written by Ryan Eatmon in February 2000 Idea By Thomas Charron in
59 January of 2000 for http://etherx.jabber.org/streams/
60
61 Currently maintained by Darian Anthony Patrick.
62
64 Copyright (C) 1998-2004 Jabber Software Foundation http://jabber.org/
65
66 This module licensed under the LGPL, version 2.1.
67
68
69
70perl v5.36.0 2023-01-20 XML::Stream::Namespace(3)