DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21712>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21712 XMLSerializer misses ignorableWhiteSpace when not indenting Summary: XMLSerializer misses ignorableWhiteSpace when not indenting Product: Xerces2-J Version: 2.4.0 Platform: All OS/Version: Windows NT/2K Status: NEW Severity: Normal Priority: Other Component: Serialization AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] We use org.apache.xml.serialize.XMLSerializer in 'xni-mode', so as a document handler. What we strive for is correct roundtrip in parsing+serializing, so we don't have indenting on. However, we would like all whitespace that was in the original file back. However, in BaseMarkupSerializer::ignorableWhitespace, the whitespace will only be added if indenting mode is on, so whitespace between element-borders is filtered out when parsing with validation. I don't think that is correct. I now extended XML Serializer with overrided public void ignorableWhitespace(char[] chars, int i, int i1) throws SAXException { this._indenting = true; try { super.ignorableWhitespace(chars, i, i1); } finally { this._indenting = false; } } Then the roundtrip on parse (with validation on) plus serialize is perfect, all the whitespace is back. Should ignorableWhitespace not always put the whitespace in, regardless of whether indenting is on or off? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
