.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XML::SAX::Machines 3pm" .TH XML::SAX::Machines 3pm "2020-12-29" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XML::SAX::Machines \- manage collections of SAX processors .SH "VERSION" .IX Header "VERSION" version 0.46 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use XML::SAX::Machines qw( :all ); \& \& my $m = Pipeline( \& "My::Filter1", ## My::Filter1 autoloaded in Pipeline() \& "My::Filter2", ## My::Filter2 " " " \& \e*STDOUT, ## XML::SAX::Writer also loaded \& ); \& \& $m\->parse_uri( $uri ); ## A parser is autoloaded via \& ## XML::SAX::ParserFactory if \& ## My::Filter1 isn\*(Aqt a parser. \& \& ## To import only individual machines: \& use XML::SAX::Machines qw( Manifold ); \& \& ## Here\*(Aqs a multi\-pass machine that reads one document, runs \& ## it through 5 filtering channels (one channel at a time) and \& ## reassembles it in to a single document. \& my $m = Manifold( \& "My::TableOfContentsExtractor", \& "My::AbstractExtractor", \& "My::BodyFitler", \& "My::EndNotesFilter", \& "My::IndexFilter", \& ); \& \& $m\->parse_string( $doc ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1SAX\s0 machines are a way to gather and manage \s-1SAX\s0 processors without going nuts. Or at least without going completely nuts. Individual machines can also be like \s-1SAX\s0 processors; they don't need to parse or write anything: .PP .Vb 3 \& my $w = XML::SAX::Writer\->new( Output => \e*STDOUT ); \& my $m = Pipeline( "My::Filter1", "My::Filter2", { Handler => $w } ); \& my $p = XML::SAX::ParserFactory\->new( handler => $p ); .Ve .PP More documentation to come; see XML::SAX::Pipeline, XML::SAX::Manifold, and XML::SAX::Machine for now. .PP Here are the machines this module knows about: .PP .Vb 2 \& ByRecord Record oriented processing of documents. \& L \& \& Machine Generic "directed graph of SAX processors" machines. \& L \& \& Manifold Multipass document processing \& L \& \& Pipeline A linear sequence of SAX processors \& L \& \& Tap An insertable pass through that examines the \& events without altering them using SAX processors. \& L .Ve .SS "Config file" .IX Subsection "Config file" As mentioned in \*(L"\s-1LIMITATIONS\*(R"\s0, you might occasionally need to edit the config file to tell XML::SAX::Machine how to handle a particular \s-1SAX\s0 processor (\s-1SAX\s0 processors use a wide variety of \s-1API\s0 conventions). .PP The config file is a the Perl module XML::SAX::Machines::SiteConfig, which contains a Perl data structure like: .PP .Vb 1 \& package XML::SAX::Machines::SiteConfig; \& \& $ProcessorClassOptions = { \& "XML::Filter::Tee" => { \& ConstructWithHashedOptions => 1, \& }, \& }; .Ve .PP So far \f(CW$Processors\fR is the only available configuration structure. It contains a list of \s-1SAX\s0 processors with known special needs. .PP Also, so far the only special need is the ConstructWithHashes option which tells XML::SAX::Machine to construct such classes like: .PP .Vb 3 \& XML::Filter::Tee\->new( \& { Handler => $h } \& ); .Ve .PP instead of .PP .Vb 1 \& XML::Filter::Tee\->new( Handler => $h ); .Ve .PP \&\fB\s-1WARNING\s0\fR If you modify anything, apply your changes in a new file created from XML::SAX::Machines::SiteConfig.pm. On Debian systems, this should be placed in /etc/perl so that it is not overwritten during upgrade. Do not alter XML::SAX::Machines::ConfigDefaults.pm or you will lose your changes when you upgrade. .PP \&\s-1TODO:\s0 Allow per-app and per-machine overrides of options. When needed. .SH "NAME" .Vb 1 \& XML::SAX::Machines \- manage collections of SAX processors .Ve .SH "AUTHORS" .IX Header "AUTHORS" Barrie Slaymaker .SH "LICENCE" .IX Header "LICENCE" Copyright 2002\-2009 by Barrie Slaymaker. .PP This software is free. It is licensed under the same terms as Perl itself. .SH "AUTHORS" .IX Header "AUTHORS" .IP "\(bu" 4 Barry Slaymaker .IP "\(bu" 4 Chris Prather .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2013 by Barry Slaymaker. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.