GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  POE::FILTER::XML::NODE (3)

.ds Aq ’

NAME

POE::Filter::XML::Node - A XML::LibXML::Element subclass that adds streaming semantics

CONTENTS

VERSION

version 1.140700

SYNOPSIS



    use POE::Filter::XML::Node;

    my $node = POE::Filter::XML::Node->new(iq);

    $node->setAttributes(
        [to, foo@other,
        from, bar@other,
        type, get]
    );

    my $query = $node->addNewChild(jabber:iq:foo, query);

    $query->appendTextChild(foo_tag, bar);

    say $node->toString();

    --

    (newlines and tabs for example only)

    <iq to=foo@other from=bar@other type=get>
        <query xmlns=jabber:iq:foo>
            <foo_tag>bar</foo_tag>
        </query>
    </iq>



DESCRIPTION

POE::Filter::XML::Node is a XML::LibXML::Element subclass that aims to provide a few extra convenience methods and light integration into a streaming context.

This module can be used to create arbitrarily complex XML data structures that know how to stringify themselves.

PUBLIC_ATTRIBUTES

    stream_[start|end]



    is: ro, isa: Bool, default: false



These two attributes define behaviors to toString() for the node. In the case of stream_start, this means dropping all children and merely leaving the tag unterminated (eg. <start>). For stream_end, it will drop any children and treat the tag like a terminator (eg. </end>).

Each attribute has a private writer (’_set_stream_[start|end]’) if it necessary to manipulate these attributes post construction.

PUBLIC_METHODS

    override cloneNode



    (Bool $deep)



cloneNode is overriden to carry forward the stream_[end|start] attributes

    override toString



    (Bool $formatted)



toString was overridden to provide special stringification semantics for when stream_start or stream_end are boolean true.

    setAttributes



    (ArrayRef $array_of_tuples)



setAttributes() accepts a single arguement: an array reference. Basically you pair up all the attributes you want to be into the node (ie. [attrib, value]) and this method will process them using setAttribute(). This is just a convenience method.

If one of the attributes is ’xmlns’, setNamespace() will be called with the value used as the $nsURI argument, with no prefix, and not activated.



 eg.
 [xmlns, http://foo]
        |
        V
 setNamespace($value, , 0)
        |
        V
 <node xmlns="http://foo"/>



    getAttributes



    returns (HashRef)



This method returns all of the attribute nodes on the Element (filtering out namespace declarations) as a HashRef.

getFirstChildByTagName(Str CW$name)



    returns (Maybe[POE::Filter::XML::Node])



This is a convenience method that basically does:
(getChildrenByTagName($name))[0]

    getChildrenHash



    returns (HashRef)



getChildrenHash() returns a hash reference to all the children of that node. Each key in the hash will be node name, and each value will be an array reference with all of the children with that name.

AUTHOR

Nicholas R. Perez <nperez@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Nicholas R. Perez <nperez@cpan.org>.

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 POE::FILTER::XML::NODE (3) 2014-03-11

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.