>What is the reason for not implementing a default >simple serializer for org.w3c.dom.Node.toString()?
The DOM makes no promise that toString() works at all, so any behavior is acceptable. The question is just whether the current behavior is optimal... and I can argue that it is. When I wrote the early prototype of the Xerces DOM, I wanted toString() to do _something_ simply for ease of debugging, so I implemented the minimal routines which (I think) are still present. But it wasn't intended to be a serializer... and in fact if you want a debugging printout, a serializer is generally the WRONG thing; usually, you just want to know what this node looks like, not what its contents look like. Even a "simple" serializer is a lot of code if you want to do a vaguely adequate job; take a look at the Xerces serializer classes. It probably wouldn't be a good thing to require that all users of the DOM carry that code around, or to run all that code every time someone wants a quick "what am I looking at" display. If you want to serialize, call the serializer classes. ______________________________________ Joe Kesselman / IBM Research --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
