Barrie Slaymaker > StateML > StateML::SAXHandler

Download:
StateML-0.22.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.001   Source  

NAME ^

StateML::SAXHandler - convert a SAX stream to a StateML::Machine

SYNOPSIS ^

    ## From StateML::parse()
    require StateML::SAXHandler;
    require XML::Filter::Mode;
    my $handler = StateML::SAXHandler->new( $machine ) ;

    my $mode_filter = XML::Filter::Mode->new(
        Handler => $handler,
        Modes   => [$machine->modes],
    );

    ## Require PurePerl for now to get the bugs out
    local $XML::ParserPackage = "XML::SAX::PurePerl";
    my $p = XML::SAX::ParserFactory->parser( 
        Handler           => $mode_filter,
        UseAttributeOrder => 1,
        Source            => $source,
    ) ;

    return $p->parse ;

DESCRIPTION ^

Use like a normal SAX handler, then collect the machine from the SAX pipline's end_document() event.

See XML::Filter::Modes for an oft-used prefilter to "shape" your machines by giving elements to nodes.

See StateML::parse() for source examples.

LIMITATIONS ^

Alpha code. Ok test suite, but we may need to change things in non-backward compatible ways.

COPYRIGHT ^

    Copyright 2003, R. Barrie Slaymaker, Jr., All Rights Reserved

LICENSE ^

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

AUTHOR ^

Barrie Slaymaker <barries@slaysys.com>

syntax highlighting: