> Besides, Assaf, I really think that a serializer ought to look into the > Text nodes and deal with the fact that there may be some leading and > trailing whitespace. I consider not doing so a bug, since it makes all > of your efforts to smartly indent the nodes moot.
???? If the serializer decides to trim whitespaces by itself, it might delete spaces that were intended to be there and lose information. Typically you serialize what you produce (either as DOM and SAX), so if you tell the serializer that 4 spaces should be printed, the serializer must obey your every command and print exactly four spaces. Anything else would be a violation of the serialization contract. I would like to point out the interesting fact that the serializer works perfectly well with ProjectX, OpenXML and Xerces when using SAX. It also works very well when documents are void of any ignorable white space. It also works very well when Java objects are serializer using Castor. The only place it breaks is when a nicely formatted document is read into a DOM tree. It breaks the serializer and it also breaks Tomcat and Ant (hint, hint) arkin > -- > Arnaud Le Hors - IBM Cupertino, XML Technology Group