XML-Compile-Dumper-0.13/0000755000175000001440000000000011353104500014123 5ustar markovusersXML-Compile-Dumper-0.13/MANIFEST0000644000175000001440000000031111353104500015247 0ustar markovusersChangeLog MANIFEST Makefile.PL README lib/XML/Compile/Dumper.pm lib/XML/Compile/Dumper.pod t/01use.t t/20dump.t t/99pod.t META.yml Module meta-data (added by MakeMaker) XML-Compile-Dumper-0.13/ChangeLog0000644000175000001440000000123211353104450015677 0ustar markovusers=== version history of XML::Compile::Dumper All changes made by Mark Overmeer, unless explicitly noted differently. version 0.13: Fri Mar 26 11:14:56 CET 2010 Fix: - name of test file in MANIFEST version 0.12: Fri Mar 26 10:14:04 CET 2010 Fixes: - do not use /bin/pwd in t/99pod.t - add "use Log::Report" to the output [Robin V.] version 0.11: Mon Nov 24 13:47:18 CET 2008 Changes: - requires XML::Compile::Tester - correct abstract version 0.10: Sun Dec 23 10:39:04 CET 2007 - split-off from XML::Compile, to + reduce the number of dependencies for XML::Compile + to give Yves some time to adapt Data::Dump::Streamer to perl5.10 XML-Compile-Dumper-0.13/Makefile.PL0000644000175000001440000000215011353104450016077 0ustar markovusersuse ExtUtils::MakeMaker; use 5.008; WriteMakefile ( NAME => 'XML::Compile::Dumper' , VERSION => '0.13' , PREREQ_PM => { XML::LibXML => 1.63 , Data::Dump::Streamer => 2.08 , XML::Compile => 0.64 , XML::Compile::Tester => 0.01 , Math::BigInt => 1.77 , Log::Report => 0.09 , Test::More => 0.54 , Test::Pod => '1.00' } , AUTHOR => 'Mark Overmeer' , ABSTRACT => 'Remember precompiled XML processors' , LICENSE => 'perl' ); ### used by oodist during production of distribution sub MY::postamble { <<'__POSTAMBLE' } # for DIST RAWDIR = ../public_html/xml-compile-dumper/raw DISTDIR = ../public_html/xml-compile-dumper/source LICENSE = artistic FIRST_YEAR = 2007 EMAIL = perl@overmeer.net WEBSITE = http://perl.overmeer.net/xml-compile/ PODTAIL = ../XML-shared-podtail # for HTML HTML_OUTPUT = ../public_html/xml-compile/html HTML_DOCROOT = /xml-compile/html HTML_PACKAGE = ../public_html/xml-compile/htmlpkg __POSTAMBLE XML-Compile-Dumper-0.13/t/0000755000175000001440000000000011353104500014366 5ustar markovusersXML-Compile-Dumper-0.13/t/99pod.t0000644000175000001440000000041211353104450015520 0ustar markovusers#!/usr/bin/perl use warnings; use strict; use Test::More; BEGIN { eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; plan skip_all => "devel home uses OODoc" if $ENV{MARKOV_DEVEL}; } all_pod_files_ok(); XML-Compile-Dumper-0.13/t/01use.t0000644000175000001440000000143711353075345015533 0ustar markovusers#!/usr/bin/perl use warnings; use strict; use lib 'lib', '../LogReport/lib'; use Test::More tests => 1; # The versions of the following packages are reported to help understanding # the environment in which the tests are run. This is certainly not a # full list of all installed modules. my @show_versions = qw/Test::More XML::LibXML XML::Compile Data::Dump::Streamer /; foreach my $package (@show_versions) { eval "require $package"; no strict 'refs'; my $report = !$@ ? "version ". (${"$package\::VERSION"} || 'unknown') : $@ =~ m/^Can't locate/ ? "not installed" : "reports error"; warn "$package $report\n"; } my $xml2_version = XML::LibXML::LIBXML_DOTTED_VERSION(); warn "libxml2 $xml2_version\n"; require_ok('XML::Compile::Dumper'); XML-Compile-Dumper-0.13/t/20dump.t0000644000175000001440000000147111353075345015703 0ustar markovusers#!/usr/bin/perl use warnings; use strict; use lib 'lib', 't'; #use TestTools; use XML::Compile::Dumper; use Test::More tests => 7; my $testfile = 't/dump.pm'; my $package = 't::dump'; unlink $testfile; my $save = XML::Compile::Dumper->new ( filename => $testfile , package => $package ); my $x = 'earth'; $save->freeze ( aap => sub {42} # simple , noot => sub {$x} # closure ); $save->close; ok(-f $testfile, 'dumpfile created'); cmp_ok(-s $testfile, '>', 290, 'some contents found'); eval "require $package"; is("$@", '', 'no parse errors'); $package->import; { no strict 'refs'; ok(defined *{"main::aap" }{CODE}, 'found aap'); ok(defined *{"main::noot"}{CODE}, 'found noot'); } cmp_ok(aap(), "==", 42, 'call aap' ); cmp_ok(noot(), "cmp", 'world', 'call noot'); unlink $testfile; XML-Compile-Dumper-0.13/META.yml0000644000175000001440000000131711353104500015376 0ustar markovusers--- #YAML:1.0 name: XML-Compile-Dumper version: 0.13 abstract: Remember precompiled XML processors license: perl author: - Mark Overmeer generated_by: ExtUtils::MakeMaker version 6.42 distribution_type: module requires: Data::Dump::Streamer: 2.08 Log::Report: 0.09 Math::BigInt: 1.77 Test::More: 0.54 Test::Pod: 1.00 XML::Compile: 0.64 XML::Compile::Tester: 0.01 XML::LibXML: 1.63 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.3.html version: 1.3 XML-Compile-Dumper-0.13/lib/0000755000175000001440000000000011353104500014671 5ustar markovusersXML-Compile-Dumper-0.13/lib/XML/0000755000175000001440000000000011353104500015331 5ustar markovusersXML-Compile-Dumper-0.13/lib/XML/Compile/0000755000175000001440000000000011353104500016721 5ustar markovusersXML-Compile-Dumper-0.13/lib/XML/Compile/Dumper.pod0000644000175000001440000001026511353104475020700 0ustar markovusers=head1 NAME XML::Compile::Dumper - Remember precompiled XML processors =head1 SYNOPSIS # create readers and writers or soap things my $reader = $schema->compile(READER => '{myns}mytype'); my $writer = $schema->compile(WRITER => ...); # then dump them into a package my $dumper = XML::Compile::Dumper->new (package => 'My::Package', filename => 'My/Package.pm'); $dumper->freeze(foo => $reader, bar => $writer); $dumper->close; # later, they can get recalled using use My::Package; my $hash = foo($xml); my $doc = bar($doc, $xml); =head1 DESCRIPTION This module simplifies the task of saving and loading pre-compiled translators. Schema's can get huge, and when you are not creating a daemon to do the XML communication, you may end-up compiling and interpreting these large schemas often, just to be able to process simple data-structures. Based on the excellent module Data::Dump::Streamer, this module helps you create standard Perl packages which contain the reader and writer code references. WARNING: this feature was introduced in release 0.17. Using perl 5.8.8, libxml 2.6.26, XML::LibXML 2.60, and Data::Dump::Streamer 2.03, Perl complains about C<"PmmREFCNT_dec: REFCNT decremented below 0! during global destruction."> when the tests are run. This bug can be anywhere. Therefore, these tests are disabled by default in t/TestTools.pm. If you have time, could you please run the tests with C<$skip_dumper = 0;> and report the results to the author? =head1 METHODS =head2 Constructors $obj-EB =over 4 Finalize the produced file. This will be called automatically if the objects goes out-of-scope. =back XML::Compile::Dumper-EB(OPTIONS) =over 4 Create an object which will collect the information for the output file. You have to specify either a C or a C. A filehandle will be closed after processing. Option --Default filehandle undef filename undef package . filehandle => C . filename => FILENAME =over 4 The file will be written using utf8 encoding, using IO::File. If you want something else, open your filehandle first, and provide that as argument. =back . package => PACKAGE =over 4 The name-space which will be used: it will produce a C line in the output. =back =back =head2 Accessors $obj-EB =over 4 Returns the output file-handle, which you may use to add extensions to the module. =back =head2 Producers $obj-EB