The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

XML::Stream - Creates and XML Stream connection and parses return data

SYNOPSIS

XML::Stream is an attempt at solidifying the use of XML via streaming.

DESCRIPTION

This modle provides the user with methods to connect to a remote server,
send a stream of XML to the server, and receive/parse an XML stream from
the server.  It is primarily based work for the Etherx XML router  
developed by the Jabber Development Team.  For more information about
this project visit http://etherx.jabber.org/stream/.

XML::Stream gives the user the ability to define a central callback
that will be used to handle the tags received from the server.  These
tags are passed in the format of an XML::Parser::Tree object.  After
the closing tag of an object is seen, the tree is finished and passed
to the call back funtion.  What the user does with it from there is up
to them.

For a detailed description of how this module works, and about the data
structure that it returns, please view the source of Stream.pm and 
look at the detailed description at the end of the file.

EXAMPLES

  ##########################
  # simple example

  use XML::Stream;

  $stream = new XML::Stream;

  $stream->Connect(name => "jabber.org", 
                   port => 5222, 
                   namespace => "jabber:client") || die $!;

  while($node = $stream->Process())
  {
    # do something with $node
  }


  ###########################
  # example using a handler

  use XML::Stream;

  $stream = new XML::Stream;
  $stream->OnNode(\&noder);
  $stream->Connect(name => "jabber.org",
		   port => 5222,
		   namespace => "jabber:client",
		   timeout => undef) || die $!;

  # Blocks here forever, noder is called for incoming 
  # packets when they arrive.
  $stream->Process();

  sub noder
  {
    my $node = shift;
    # do something with $node
  }

AUTHOR

Tweaked, tuned, and brightness changes by Ryan Eatmon, reatmon@ti.com Colorized, and Dolby Surround sound added by Thomas Charron, tcharron@jabber.org By Jeremie in October of 1999 for http://etherx.jabber.org/streams/

COPYRIGHT

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