Hi, I recently discovered that when parsing an XML document using DOM with "include-ignorable-whitespace" feature on (which is default), all white space located outside the root element is still lost! For example, a trailing new line character at the end of the document will be lost, as well as linefeeds between comments before the root element. This is a problem (although a cosmetic one) when you parse a document and then serializes it. The output will not be the same as the input.
Example: <?xml version="1.0"?> <!-- comment 1 --> <!-- comment 2 --> <root> Some data </root> Will after parsing/serialization become <?xml version="1.0"?> <!-- comment 1 --><!-- comment 2 --><root> Some data </root> Is this a bug in the parser or perhaps in DOM? Any workarounds? I have tried xerces 2.6.2 and 2.7.0 with JAXP 1.3 with the same result. Thanx, Torkel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
