Re: Namespace support in SAX serialisers
by Robin Berjon other posts by this author
Oct 17 2005 9:20AM messages near this date
view in the new Beta List Site
Re: Namespace support in SAX serialisers
|
Re: Namespace support in SAX serialisers
& XSLT On Oct 17, 2005, at 16:59, A. Pagaltzis wrote:
> * Robin Berjon <robin.berjon@[...].fr> [2005-10-17 12:15]:
> > Ideally, this sort of functionality which turns a
> > non-conformant stream into a conformant one should be
> > abstracted into a separate module (a filter) so that other
> > pieces of the SAX infrastructure could reuse it.
>
> I thought about this but didnâ??t want to suggest it yet. A problem
> with this approach is that the behaviour of serialisers when used
> directly is left undefined. It would be good to know for definite
> sure what the serialisers are expected to do. If a serialiser is
> *supposed* to infer the missing information, then serialisers
> should implement this behaviour directly, not in the form of a
> wrapper. They donâ??t need to implement this themselves; it could
> be done inside something like XML::SAX::Base (maybe
> XML::SAX::Writer::Base?) which a serialiser can then inherit
> from.
Actually, I don't think that we want to specify what writers are
supposed to do. The reason for this is because doing it in full would
be very complex and time consuming, and also it might prevent people
from doing things that are perfectly normal in a writer. Also, the
spec already says what a SAX event must contain, it just so happens
that some writers make more efforts in terms of trying to handle
broken streams. This has downsides in interoperability as people
might not detect bugs, but it makes working with them a whole lot
easier. If we do get a normalizing filter, it would be nice if it had
an option to warn when it sees an invalid event so that people could
test and fix their code.
What I do think we should do is promote best practices, which as
usual in Perl means DWIMming (except when it doesn't). If Dom writes
XML::Filter::Normalizer, then writers should use this directly. Note
that I'm not saying that people should place that filter between
their code and the writer themselves, I think the writer should do
that for them. If you look at what sort of object XSW returns from
its constructor, you'll see that it's not what you might expect --
it's already returning a filter (which it needs for some of its
escaping code).
--
Robin Berjon
Senior Research Scientist
Expway, http://expway.com/
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
A. Pagaltzis
Petr Cimprich
A. Pagaltzis
Petr Cimprich
A. Pagaltzis
Robin Berjon
Petr Cimprich
Dominic Mitchell
A. Pagaltzis
Robin Berjon
Dominic Mitchell
Robin Berjon
A. Pagaltzis
Robin Berjon
A. Pagaltzis
Robin Berjon
A. Pagaltzis
A. Pagaltzis
Dominic Mitchell
Robin Berjon
Dominic Mitchell
A. Pagaltzis
Dominic Mitchell
Dominic Mitchell
|