.
=item * Fine control over which kind of quotes are used
See options below.
=item * Supports PerlSAX interface
=back
=head1 Constructor Options
=over 4
=item * EndWithNewline (Default: 1)
Whether to print a newline at the end of the file (i.e. after the root element)
=item * Newline (Default: undef)
If defined, which newline to use for printing.
(Note that XML::Parser etc. convert newlines into "\x0A".)
If undef, newlines will not be converted and XML::Handler::Composer will
use "\x0A" when printing.
A value of "\n" will convert the internal newlines into the platform
specific line separator.
See the PreserveWS option in the characters event (below) for finer control
over when newline conversion is active.
=item * DocTypeIndent (Default: a Newline and 2 spaces)
Newline plus indent that is used to separate lines inside the DTD.
=item * IndentAttList (Default: 8 spaces)
Indent used when printing an declaration that has more than one
attribute definition, e.g.
=item * Quote (Default: { XMLDecl => '"', Attr => '"', Entity => '"', SystemLiteral => '"' })
Quote contains a reference to a hash that defines which quoting characters
to use when printing XML declarations (XMLDecl), attribute values (Attr),
values (Entity) and system/public literals (SystemLiteral)
as found in , declarations etc.
=item * PrintDefaultAttr (Default: 0)
If 1, prints attribute values regardless of whether they are default
attribute values (as defined in declarations.)
Normally, default attributes are not printed.
=item * Encoding (Default: undef)
Defines the output encoding (if specified.)
Note that future calls to the xml_decl() handler may override this setting
(if they contain an Encoding definition.)
=item * EncodeUnmapped (Default: \&XML::UM::encode_unmapped_dec)
Defines how Unicode characters not found in the mapping file (of the
specified encoding) are printed.
By default, they are converted to decimal entity references, like '{'
Use \&XML::UM::encode_unmapped_hex for hexadecimal constants, like '«'
=item * Print (Default: sub { print @_ }, which prints to stdout)
The subroutine that is used to print the encoded XML output.
The default prints the string to stdout.
=back
=head1 Method: get_compressed_element_suffix ($event)
Override this method to support the different styles for printing
empty elements in compressed notation, e.g. , , , .
The default returns "/>", which results in
.
Use " />" for XHTML style elements or ">" for certain HTML style elements.
The $event parameter is the hash reference that was received from the
start_element() handler.
=head1 Extra PerlSAX event information
XML::Handler::Composer relies on hints from previous SAX filters to
format certain parts of the XML.
These SAX filters (e.g. XML::Filter::Reindent) pass extra information by adding
name/value pairs to the appropriate PerlSAX events (the events themselves are
hash references.)
=over 4
=item * entity_reference: Parameter => 1
If Parameter is 1, it means that it is a parameter entity reference.
A parameter entity is referenced with %ent; instead of &ent; and the
entity declaration starts with instead of
NOTE: This should be added to the PerlSAX interface!
=item * start_element/end_element: Compress => 1
If Compress is 1 in both the start_element and end_element event, the element
will be printed in compressed form, e.g. instead of .
=item * start_element: PreserveWS => 1
If newline conversion is active (i.e. Newline was defined in the constructor),
then newlines will *NOT* be converted in text (character events) within this
element.
=item * attlist_decl: First, MoreFollow
The First and MoreFollow options can be used to force successive
declarations for the same element to be merged, e.g.
In this example, the attlist_decl event for foo should contain
(First => 1, MoreFollow => 1) and the event for bar should contain
(MoreFollow => 1). The quux event should have no extra info.
'First' indicates that the event is the first of a sequence.
'MoreFollow' indicates that more events will follow in this sequence.
If neither option is set by the preceding PerlSAX filter, each attribute
definition will be printed as a separate line.
=back
=head1 CAVEATS
This code is highly experimental!
It has not been tested well and the API may change.
=head1 AUTHOR
Enno Derksen is the original author.
Send bug reports, hints, tips, suggestions to T.J. Mather at
>.
=cut
libxml-handler-composer-perl-0.01.orig/Changes 0100664 0001750 0000150 00000000207 07344735601 017145 0 ustar ardo Revision history for Perl extension XML::Handler::Composer.
0.01 Sun Aug 26 11:03:52 2001
- moved from XML-DOM to separate package
libxml-handler-composer-perl-0.01.orig/MANIFEST 0100664 0001750 0000150 00000000070 07344735601 017001 0 ustar ardo Changes
Composer.pm
Makefile.PL
MANIFEST
README
test.pl
libxml-handler-composer-perl-0.01.orig/Makefile.PL 0100664 0001750 0000150 00000000436 07344735601 017630 0 ustar ardo use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'XML::Handler::Composer',
'VERSION_FROM' => 'Composer.pm', # finds $VERSION
'PREREQ_PM' => {XML::UM => 0},
);
libxml-handler-composer-perl-0.01.orig/README 0100664 0001750 0000150 00000001303 07344735601 016530 0 ustar ardo XML::Handler::Composer version 0.01
===================================
DESCRIPTION
XML::Handler::Composer is similar to XML::Writer, XML::Handler::XMLWriter, XML::Handler::YAWriter etc. in that it
generates XML output.
This implementation may not be fast and it may not be the best solution for your particular problem, but it has some
features that may be missing in the other implementations.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
COPYRIGHT AND LICENCE
Copyright (c) 1999,2000 Enno Derksen
All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
libxml-handler-composer-perl-0.01.orig/test.pl 0100664 0001750 0000150 00000000766 07344735601 017200 0 ustar ardo # 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::Handler::Composer;
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.