XML-Writer-String-0.1/ 40777 0 0 0 7441426366 12676 5ustar usergroupXML-Writer-String-0.1/Changes100666 0 0 272 7441415423 14237 0ustar usergroupRevision history for Perl extension XML::Writer::String. 0.1 Wed Mar 6 13:35:15 2002 - original version; created by h2xs 1.21 with options -AX -n XML::Writer::String -v 0.1 XML-Writer-String-0.1/example/ 40777 0 0 0 7441425342 14322 5ustar usergroupXML-Writer-String-0.1/example/eg.pl100666 0 0 761 7441425302 15327 0ustar usergroup#!/usr/bin/perl use warnings; use strict; use XML::Writer; use XML::Writer::String; my $s = XML::Writer::String->new(); my $writer = new XML::Writer( OUTPUT => $s, DATA_MODE => 1, DATA_INDENT => 4); $writer->xmlDecl(); $writer->startTag('module', name=>'XML::Writer::String'); $writer->dataElement('abstract', 'Capture output from XML::Writer'); $writer->dataElement('author', 'S. Oliver '); $writer->endTag(); $writer->end(); print $s->value(); XML-Writer-String-0.1/example/eg.xml100666 0 0 325 7441425342 15514 0ustar usergroup Capture output from XML::Writer S. Oliver <simon.oliver@umist.ac.uk> XML-Writer-String-0.1/Makefile.PL100666 0 0 441 7441417121 14711 0ustar usergroupuse ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'XML::Writer::String', 'VERSION_FROM' => 'String.pm', 'PREREQ_PM' => {XML::Writer => 0}, ($] >= 5.005 ? (ABSTRACT_FROM => 'String.pm', AUTHOR => 'S. Oliver ') : ()), ); XML-Writer-String-0.1/MANIFEST100666 0 0 224 7441426407 14076 0ustar usergroupChanges Makefile.PL MANIFEST README String.pm test.pl example/eg.pl example/eg.xml ppm/XML-Writer-String.ppd ppm/XML-Writer-String.tar.gz XML-Writer-String-0.1/ppm/ 40777 0 0 0 7441426246 13467 5ustar usergroupXML-Writer-String-0.1/ppm/XML-Writer-String.ppd100666 0 0 665 7441426161 17432 0ustar usergroup XML-Writer-String Capture output from XML::Writer. S. Oliver <simon.oliver@umist.ac.uk> XML-Writer-String-0.1/ppm/XML-Writer-String.tar.gz100666 0 0 4634 7441426210 20067 0ustar usergroup,< XML-Writer-String.tar[oHί)C$D;{txfw!dLG7mb K 5#vuuu}Um4$/J%r@~ R3l(Ɉlvp/uWݹN09;c}_(X&- ۦϮSW'R_{kw^/d|?M Q,K,@/B17}|'b&d1d/>mЫg?[Lg?g b3+/f2B&l/sg433b|a%S, 8*7mS::(5ՆT$rẠ\6''OFcd"ޠhtf5O&Ɣ)rU>US0W}㞦uKkG| xS󥚲!XaNIpzՖ)Ԯ jwe[I]i6;5Ynë^VW?7d Wֱ+UTԛ^:0Rk6[ۆ,gqru]o7jG̘OJz(տeJO[R(}rSwp8U+CjU=~ j( h/Jn~KНG[hJB]ؽ"2ޓL<`}m;FozkL|ñSFGm[{X;CP~7myn)ȵڪBJ @jA]wL\n짤z۸QWR>PRk1يsҒauX&f)r{Llҝk] *BNu^.h,Xig{HÝiӇӳH 84ǻgY%U^fj-S8Kj \|0kf@g{~u>Dc#3 LJ kbRھG42\z1pls(ԭz[V$vqzVVV`jhc463ra䣩_+׹7q{7hl e. B3u 5aaah\]sf` #/n!SX 4/ĢCoMmX\WU#K@PC΄Ԏlfc+R-,ϫv4y3P+N&<6\ibVw{\Rzx2/fNE½kAL ![88 f@DD1l&f81\֥̏Ud*l|(S +>9t6c px<; bf~p ` v;5GѺ钽u4sc/؋bcέ1B-A-Y+^1+_t> :{o!cޘ*OQWR!ySߎb> w91OoB17 &>`B&Sf}ҿIL. 5>_/į &QSmaMf/~gU|h7n10N i Fȃp /C_J/JhH 0$pDxccX#''&ja`RW(qG!&q~?#ƈ|ُ"38S;HJ~u l9UmZK~쓟T5|5mHv;WZrQudcGz-G9KHend() is called prior to calling $s->value() to check for well-formedness. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: XML::Writer COPYRIGHT AND LICENCE Copyright (C) 2002 Simon Oliver This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. XML-Writer-String-0.1/String.pm100666 0 0 4547 7441416771 14610 0ustar usergroup=head1 NAME XML::Writer::String - Capture output from XML::Writer. =cut package XML::Writer::String; require 5.004; use warnings; use strict; $XML::Writer::String::VERSION = 0.1; sub new { my $class = shift; my $scalar = ''; my $self = bless \$scalar, $class; $self->value(@_) if @_; return $self; } sub print { my $self = shift; ${$self} .= join '', @_; return scalar(@_); } sub value { my $self = shift; @_ ? ${$self} = join('', @_) : ${$self}; } 1; __END__ =head1 SYNOPSIS use XML::Writer; use XML::Writer::String; my $s = XML::Writer::String->new(); my $writer = new XML::Writer( OUTPUT => $s ); $writer->xmlDecl(); $writer->startTag('root'); $writer->endTag(); $writer->end(); print $s->value(); =head1 DESCRIPTION This module implements a bare-bones class specifically for the purpose of capturing data from the XML::Writer module. XML::Writer expects an IO::Handle object and writes XML data to the specified object (or STDOUT) via it's print() method. This module simulates such an object for the specific purpose of providing the required print() method. It is recommended that $writer->end() is called prior to calling $s->value() to check for well-formedness. =head1 METHODS XML::Writer::String provides three methods, C, C and C: =over =item C<$s = XML::Writer::String->new([list]);> new() returns a new String handle. =item C<$count = $s->print([list]);> print() appends concatenated list data and returns number of items in list. =item C<$val = $s->value([list]);> value() returns the current content of the object as a scalar. It can also be used to initialize/overwrite the current content with concatenated list data. =back =head1 NOTES This module is designed for the specific purpose of capturing the output of XML::Writer objects, as described in this document. It does not inherit form IO::Handle. For an alternative solution look at IO::Scalar, IO::Lines, IO::String or Tie::Handle::Scalar. =head1 AUTHOR Simon Oliver =head1 COPYRIGHT Copyright (C) 2002 Simon Oliver This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L, L, L =cut XML-Writer-String-0.1/test.pl100666 0 0 1004 7441415423 14272 0ustar usergroup# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test; BEGIN { plan tests => 1 }; use XML::Writer::String; ok(1); # If we made it this far, we're ok. ######################### # Insert your test code below, the Test module is use()ed here so read # its man page ( perldoc Test ) for help writing this test script.