Re: [ANNOUNCE] XML::SAX::2Simple
by Barrie Slaymaker other posts by this author
Jan 15 2002 9:23PM messages near this date
view in the new Beta List Site
Re: [ANNOUNCE] XML::SAX::2Simple
|
Stripping UTF8 from variables.
On Tue, Jan 15, 2002 at 08:40:05PM +0000, Duncan Cameron wrote:
> Barrie
>
> How is this different to XML::SAX::Simple which Matt announced
> recently?
Good question :) I wrote this because XML::SAX::Simple is not what I
thought it was: a SAX processor that I could use to turn SAX events in
to data structures or vice versa. Just added this to the docs:
This is different from L<XML::SAX::Simple|XML::SAX::Simple> in that this
is a SAX handler that can be used at the end of any SAX processing
chain. XML::SAX::Simple is a subclass of XML::Simple that hooks
XML::Simple up to XML::SAX::ParserFactory internally. XML::SAX::Simple
cannot be used to receive or send SAX events, though it does use them
under the hood.
> Two points:
> 1) shouldn't this be within the XML::Simple namespace, e.g.
> something like XML::Simple::Builder. In fact I thought that I read
> that Grant McLean was already working on this.
Adapter classes like this usually could "naturally" be in either
namespace, I happened to drop it in XML::Handler because it's a SAX
handler and that's my habitual place for them. And, if Grant's already
working on this, he'll be wanting that name for his package, I suspect.
> 2) aren't we in danger of namespace overload/confusion with all the
> recent packages, i.e. XML::SAX::Machines, XML::Handler::xxx and
> XML::Filter::xxx.
> Maybe everthing to do with machines should be within the XML::SAXMachines
> namespace, and XML::Filter and XML::Handler should contain only
> general purpose handlers or filters.
FWIW, everything I've put in the XML::Filter or XML::Handler namespaces
are indeed SAX filters and SAX handlers; none of them are machines.
All the machines are under XML::SAX because they seem to fit there:
XML::SAX::Pipeline, XML::SAX::Manifold, XML::SAX::ByRecord, and
XML::SAX::Machine. These are "generic" XML::SAX tools, I just happen to
group them all in to being "machines" and make them all subclass the
XML::SAX::Machine class. BTW, XML::SAX::Machines is the high-level
interface to all of the above.
> I've not read the docs with all your new packages so I might be just
> confusing myself.
The XML::* namespace is a bit confusing, especially since people aren't
(and will never be) consistent in their use. I won't pick on any
modules here by name :). This is a side effect of the facts that XML is
a *huge* umbrella with a lot of technologies under it and that CPAN is a
commons and isn't regulated or controlled. Both of these things are
good things, IMHO, but it will lead to oddities.
My feeling (YMMV) is that:
XML:: "pure" XML modules that aren't really to do with
some other "ML", like RDF
XML::SAX:: modules that manage and deal with generic SAX
and are not generators, filters, or handlers.
XML::Generator:: things that emit but don't accept SAX events
XML::Filter:: things that can accept and emit sax events
XML::Handler:: things that accept but don't emit
However, I didn't create the namespaces or anything, so I just try to
get by with them :).
- Barrie
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
http://listserv.ActiveState.com/mailman/listinfo/perl-xml
Thread:
Duncan Cameron
Barrie Slaymaker
Terrence Martin
|