{
    "content": [
        {
            "type": "text",
            "text": "# XML::Stream::Namespace (perldoc)\n\n## NAME\n\nXML::Stream::Namespace - Object to make defining Namespaces easier in XML::Stream.\n\n## SYNOPSIS\n\nXML::Stream::Namespace is a helper package to XML::Stream. It provides a clean way of defining\nNamespaces for XML::Stream to use when connecting.\n\n## DESCRIPTION\n\nThis module allows you to set and read elements from an XML::Stream\nNamespace.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS**\n- **EXAMPLES**\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "XML::Stream::Namespace",
        "section": "",
        "mode": "perldoc",
        "summary": "XML::Stream::Namespace - Object to make defining Namespaces easier in XML::Stream.",
        "synopsis": "XML::Stream::Namespace is a helper package to XML::Stream. It provides a clean way of defining\nNamespaces for XML::Stream to use when connecting.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "$myNamespace = XML::Stream::Namespace->new(\"mynamspace\");",
            "$myNamespace->SetXMLNS(\"http://www.mynamespace.org/xmlns\");",
            "$myNamespace->SetAttributes(foo=>\"bar\",",
            "bob=>\"vila\");",
            "$stream = XML::Stream->new;",
            "$stream->Connect(name=>\"foo.bar.org\",",
            "port=>1234,",
            "namespace=>\"foo:bar\",",
            "namespaces=>[ $myNamespace ]);",
            "# The above Connect will send the following as the opening string",
            "# of the stream to foo.bar.org:1234...",
            "#   <stream:stream",
            "#    xmlns:stream=\"http://etherx.jabber.org/streams\"",
            "#    to=\"foo.bar.org\"",
            "#    xmlns=\"foo:bar\"",
            "#    xmlns:mynamespace=\"http://www.mynamespace.org/xmlns\"",
            "#    mynamespace:foo=\"bar\"",
            "#    mynamespace:bob=\"vila\">"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "XML::Stream::Namespace - Object to make defining Namespaces easier in XML::Stream.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "XML::Stream::Namespace is a helper package to XML::Stream. It provides a clean way of defining\nNamespaces for XML::Stream to use when connecting.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module allows you to set and read elements from an XML::Stream\nNamespace.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "SetNamespace(\"mynamespace\");\nSetXMLNS(\"http://www.mynamespace.com/xmlns\");\nSetAttributes(attrib1=>\"value1\",\nattrib2=>\"value2\");\n\nGetNamespace() returns \"mynamespace\"\nGetXMLNS() returns \"http://www.mynamespace.com/xmlns\"\nGetAttributes() returns a hash ( attrib1=>\"value1\",attrib2=>\"value2\")\nGetStream() returns the following string:\n\"xmlns:mynamespace='http://www.nynamespace.com/xmlns'\nmynamespace:attrib1='value1'\nmynamespace:attrib2='value2'\"\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "$myNamespace = XML::Stream::Namespace->new(\"mynamspace\");\n$myNamespace->SetXMLNS(\"http://www.mynamespace.org/xmlns\");\n$myNamespace->SetAttributes(foo=>\"bar\",\nbob=>\"vila\");\n\n$stream = XML::Stream->new;\n$stream->Connect(name=>\"foo.bar.org\",\nport=>1234,\nnamespace=>\"foo:bar\",\nnamespaces=>[ $myNamespace ]);\n\n#\n# The above Connect will send the following as the opening string\n# of the stream to foo.bar.org:1234...\n#\n#   <stream:stream\n#    xmlns:stream=\"http://etherx.jabber.org/streams\"\n#    to=\"foo.bar.org\"\n#    xmlns=\"foo:bar\"\n#    xmlns:mynamespace=\"http://www.mynamespace.org/xmlns\"\n#    mynamespace:foo=\"bar\"\n#    mynamespace:bob=\"vila\">\n#\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Written by Ryan Eatmon in February 2000 Idea By Thomas Charron in January of 2000 for\nhttp://etherx.jabber.org/streams/\n\nCurrently maintained by Darian Anthony Patrick.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (C) 1998-2004 Jabber Software Foundation http://jabber.org/\n\nThis module licensed under the LGPL, version 2.1.\n",
                "subsections": []
            }
        }
    }
}