StateML::SAXHandler - convert a SAX stream to a StateML::Machine
## 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 ;
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.
Alpha code. Ok test suite, but we may need to change things in non-backward compatible ways.
Copyright 2003, R. Barrie Slaymaker, Jr., All Rights Reserved
You may use this module under the terms of the BSD, Artistic, or GPL licenses, any version.
Barrie Slaymaker <barries@slaysys.com>
To install StateML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm StateML
CPAN shell
perl -MCPAN -e shell install StateML
For more information on module installation, please visit the detailed CPAN module installation guide.