Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

  (email not shown publicly)

I work for MessageLabs [] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Tuesday January 15, 2002
09:56 AM


[ #2144 ]

Barrie Slaymaker has just released XML::SAX::Machines to CPAN. For those of you who missed the announcement on the Perl-XML list, SAX::Machines is a SAX pipeline construction toolkit. It's lego for XML.

We were just now looking at neat ways you can do XML stuff on the command line with the current SAX based solutions. For example here's a passthru parser:

  • $ perl -MXML::SAX -MXML::SAX::Writer -wle 'XML::SAX::ParserFactory->parser( Handler => XML::SAX::Writer->new )->parse_string( q(<foo/>) )'

But then Barrie chimed in with this beauty, based on SAX::Machines:

  • $ perl -MXML::SAX::Machines=Pipeline -wle 'Pipeline( \*STDOUT )->parse_string( q(<foo/>) )'

SAX::Machines basically facilitates constructing SAX pipelines, and he's put some really cool facilities together so you can do this easily, including some mind blowing facilities for processing an XML document in record oriented fashion through whatever SAX engine you like. The "lego" bit is you simply pass in SAX filters or parsers or serialisers to the constructor (Pipeline in this case), and it manages the entire thing for you.

It's seriously cool technology. And I think Barrie is going to be doing an article about it some time soonish. I look forward to that.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.