My thoughts....

When the depth of the tree drops back to 0 (ie. the root element is
finished printing) The serializer should reinitialize itself. I don't
like to rely on a call to #endDocument, though there is nothing wrong
with forcing a user to do so if necessary.

I don't think a Serializer needs to be thread safe since that won't make
much sense in the event world of SAX, but I see nothing wrong with
making a serializer reusable.

--Keith


Arnaud Le Hors wrote:
> 
> Assaf Arkin wrote:
> >
> > By definition a serializer is good for printing just one document, and
> > it prints just one document.
> 
> "By definition"? Sorry, I don't understand. Do you actually simply mean
> that you didn't design/implement the serializer to print more than one
> document? It that's it, I can understand (even though I think it's
> unfortunate ;-).
> 
> > Although it's possible to print two documents with domSerializer, I'm
> > not sure if it makes sense with a DocumentHandler/ContentHandler, so I
> > would advise against it.
> 
> Could you expand on this a bit and tell us why? For one thing, people
> expect to be able to reuse the parser, so why would it be unreasonable
> to expect the same from the serializer?
> Thanks.
> --
> Arnaud  Le Hors - IBM Cupertino, XML Technology Group

Reply via email to