XML::Filter::Dispatcher::Compiler - Compile rulesets in to code


XML-Filter-Dispatcher documentation  | view source Contained in the XML-Filter-Dispatcher distribution.

Index


NAME

Top

XML::Filter::Dispatcher::Compiler - Compile rulesets in to code

SYNOPSIS

Top

    use XML::Filter::Dispatcher::Compiler qw( xinline );

    my $c = XML::Filter::Dispatcher::Compiler->new( ... )

    my $code = $c->compile(
        Package     => "My::Filter",
        Rules       => [
            'a/b/c'     => xinline q{warn "found a/b/c"},
        ],
        Output      => "lib/My/Filter.pm",  ## optional
    );

DESCRIPTION

Top

Most of the options from XML::Filter::Dispatcher are accepted.

NOTE: you cannot pass code references to compile() if you want to write the $code to disk, they will not survive. If you want to eval $code, this is ok.

METHODS

Top

xinline

Hints to X::F::D that the string is inlinable code. This is a requirement when using the compiler and is so far (v.52) ignored elswhere. In xinlined code, $self refers to the current dispatcher and $e refers to the current event's data. Or you can get that yourself in $_[0] and $_[1] as in a normal SAX event handling method.

compile

Accepts options that extend and override any previously set for the duration of the compile(), including the ruleset to compile.

LIMITATIONS

Top

COPYRIGHT

Top

LICENSE

Top

You may use this module under the terms of the BSD, Artistic, or GPL licenses, any version.

AUTHOR

Top

Barrie Slaymaker <barries@slaysys.com>


XML-Filter-Dispatcher documentation  | view source Contained in the XML-Filter-Dispatcher distribution.