[Libxmlplusplus-general] Parser abstraction



hi there,

libxml++ currently defines an abstract 'Parser' interface,
which is implemented once to provide a DOM parser, and once
for SAX.

I'm wondering how useful such ab abstraction is. The implementation
is completely different, and even for users there isn't anything
the two have in common, i.e. the semantics of 'parse file "foo"' is
very different.

I'v (locally) introduced a 'Document' class, which is created
by a 'create_document_from[file, stream, memory]' factory function.
Note that this is really a function, as there isn't any state involved.
Either you end up with a document, or you don't (an exception may be
thrown to indicate failure).

What do you think about such a change ? Do we still need an abstract
Parser class ?

Regards,
		Stefan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]