This is really a question for Matts, but maybe someone else here has an answer. I am trying to use XML::Filter::SAX1toSAX2 and XML::Filter::SAX2toSAX1, but can't even get the Synopsis code to compile. If you want to try this out, you will need to download and install the following:
Here is the code for SAX1to2:
use strict; use XML::Handler::AxPoint; use XML::Filter::SAX1toSAX2; use XML::Parser::PerlSAX; my $handler = XML::Handler::AxPoint->new(); my $filter = XML::Filter::SAX1toSAX2->new(Handler => $handler); my $parser = XML::Parser::PerlSAX->new(Handler => $filter); $parser->parse(Source => { SystemId => "foo.xml" }); __END__ yields: Can't call method "push_context" on an undefined value at /usr/lib/perl5/site_perl/5.6.0/XML/Filter/SAX1toSAX2.pm line 25.
And here is SAX2to1:
use strict; use XML::Handler::YAWriter; use XML::Filter::SAX2toSAX1; use XML::SAX::ParserFactory; my $handler = XML::Handler::YAWriter->new(); my $filter = XML::Filter::SAX2toSAX1->new(Handler => $handler); my $parser = XML::SAX::ParserFactory->parser(Handler => $filter); $parser->parse_uri( "foo.xml" ); __END__ yields: Not an ARRAY reference at /usr/lib/perl5/site_perl/5.6.0/XML/Filter/SAX2toSAX1.pm line 47.
These seem like bugs, but since i am new to these modules, i suspect i am doing something wrong. Thanks in advance. :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to SAX Filter: 2to1 and 1to2 by jeffa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.