Piers Harding > Jabber-mod_perl-0.04 > Jabber::NADs

Download:
Jabber-mod_perl-0.04.tar.gz

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: Jabber-mod_perl-0.15

NAME ^

Jabber::NADs - Perl wrapper for Jabber NADs for management of XML nodes

SYNOPSIS ^

  use Jabber::NADs;
  my $nc = Jabber::NADs::nadCache();
  my $nad = Jabber::NADs::newNAD( $nc );

DESCRIPTION ^

Jabber::NADs is a wrapper for the nad_t struct based object representing an XML packet fragment in the jabberd2 sm ( session manager ). The API is almost identical to that of the nad API of the utils library, and as such the utils documentation can be refered to.

METHODS ^

cache_new()

A static method to create a new NAD cache - you really shouldn't call this yourself - it is for testing purposes. jabberd2 controls the creation of nad_cache so there is no need for the user to do this.

 my $nc = Jabber::NADs::cache_new();

cache_free()

A static method to free a NAD cache - this is controled by jabberd2, so no need to call this - this is for testing purposes only.

 Jabber::NADs::cache_free( $nc );

nad_new()

A static method to create a new NAD.

 my $n = Jabber::NADs::nad_new( $nc );

free()

A method to free a NAD

 $nad->free();

copy()

A method to copy a NAD

 my $ncopy = $nad->copy( );

append_elem()

A method to append an element to a NAD

 $n->nad_append_element( $ns, $name, $depth );

insert_elem()

A method to insert an element into a NAD

 $n->insert_elem( $startelem, $ns, $name, $cdata );

find_elem()

A method to find an element in a NAD

 $n->find_elem( $startelem, $ns, $name, $depth );

append_cdata()

A method to append CDATA to a NAD.

 $n->append_cdata( $cdata, $len, $depth );

add_namespace()

A method to add a namespace to a NAD returns an integer representing the namespace.

 $n->add_namespace( $name );

find_namespace()

A method to find a namespace within a NAD starting at a specific element. returns an integer representing the namespace.

 $n->find_namespace( $elem, $uri, $prefix );

find_scoped_namespace()

A method to find a namespace within a NAD - returns an integer representing the namespace.

 $n->find_scoped_namespace( $uri, $prefix );

findAttr()

A method to find the attributes of a NAD. Value is optional. returns an integer representing the position of the attribute.

 $n->findAttr( $startelem, $name, $value );

getAttr()

A method to find the attributes of a NAD. Value is optional. returns an integer representing the position of the attribute.

 $n->getAttr( $attr );

setAttr()

A method to set the value of attributes of a NAD.

 $n->setAttr( $startelem, $name, $value );

appendAttr()

A method to append attributes to an element of a NAD.

 $n->appendAttr( $name, $value );

print()

A method to print a NAD (serialise the xml)

 $n->print( $depth );

VERSION ^

very new

AUTHOR ^

Piers Harding

SEE ALSO ^

COPYRIGHT ^

Copyright (c) 2002, Piers Harding. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.