Return-Path: Delivered-To: apmail-xmlgraphics-fop-dev-archive@www.apache.org Received: (qmail 37643 invoked from network); 27 Apr 2006 07:59:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Apr 2006 07:59:25 -0000 Received: (qmail 732 invoked by uid 500); 27 Apr 2006 07:59:19 -0000 Delivered-To: apmail-xmlgraphics-fop-dev-archive@xmlgraphics.apache.org Received: (qmail 654 invoked by uid 500); 27 Apr 2006 07:59:18 -0000 Mailing-List: contact fop-dev-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: fop-dev@xmlgraphics.apache.org Delivered-To: mailing list fop-dev@xmlgraphics.apache.org Received: (qmail 643 invoked by uid 99); 27 Apr 2006 07:59:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 00:59:18 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [213.239.215.103] (HELO tux17.hoststar.ch) (213.239.215.103) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 00:59:17 -0700 Received: from [127.0.0.1] (zux221-204-082.adsl.green.ch [81.221.204.82]) (authenticated bits=0) by tux17.hoststar.ch (8.12.11/8.12.11) with ESMTP id k3R7wwWl012961 for ; Thu, 27 Apr 2006 09:58:59 +0200 Date: Thu, 27 Apr 2006 09:58:38 +0200 From: Jeremias Maerki To: fop-dev@xmlgraphics.apache.org Subject: Bug in whitespace handling with linefeed-treatment="ignore"? Message-Id: <20060427093807.C0A7.DEV@jeremias-maerki.ch> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------_445074DFC0B304DEC008_MULTIPART_MIXED_" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.25.01 [en] X-Antivirus: avast! (VPS 0617-2, 04/26/2006), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------_445074DFC0B304DEC008_MULTIPART_MIXED_ Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Maybe you have seen the thread on fop-users: http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200604.mbox/%3c20060427085832.C09F.DEV@jeremias-maerki.ch%3e The patch below fixes the attached example in the way I would expect (but only for linefeed-treatment="ignore", the other values would have to be checked, too). However, I'm not sure it this is right, but white-space-treatment is handled "before any linefeed-treatment handling is considered" (XSL-FO 1.0, 7.15.8). I think the afterLineFeed variable is currently not properly set. It also looks like our testcases don't cover this particular constellation. What adds to my uncertainty is that XEP does not behave as I would expect in this case (it seems to remove the tab but not the spaces). Any insight, whitespace specialists? Index: src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java =================================================================== --- src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java (revision 397142) +++ src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java (working copy) @@ -226,6 +226,7 @@ switch (linefeedTreatment) { case Constants.EN_IGNORE: charIter.remove(); + afterLinefeed = true; // for following whitespace break; case Constants.EN_TREAT_AS_ZERO_WIDTH_SPACE: charIter.replaceChar(CharUtilities.ZERO_WIDTH_SPACE); Jeremias Maerki --------_445074DFC0B304DEC008_MULTIPART_MIXED_ Content-Type: application/octet-stream; name="linefeed-treatment-ignore.fo" Content-Disposition: attachment; filename="linefeed-treatment-ignore.fo" Content-Transfer-Encoding: base64 PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KDQo8Zm86cm9vdCB4 bWxuczpmbz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS9YU0wvRm9ybWF0Ij4NCiAgPGZvOmxheW91 dC1tYXN0ZXItc2V0Pg0KICAgIDxmbzpzaW1wbGUtcGFnZS1tYXN0ZXIgbWFzdGVyLW5hbWU9Im15 LXBhZ2UiPg0KICAgICAgPGZvOnJlZ2lvbi1ib2R5IG1hcmdpbj0iMWluIi8+DQogICAgPC9mbzpz aW1wbGUtcGFnZS1tYXN0ZXI+DQogIDwvZm86bGF5b3V0LW1hc3Rlci1zZXQ+DQoNCiAgPGZvOnBh Z2Utc2VxdWVuY2UgbWFzdGVyLXJlZmVyZW5jZT0ibXktcGFnZSI+DQogICAgPGZvOmZsb3cgZmxv dy1uYW1lPSJ4c2wtcmVnaW9uLWJvZHkiPg0KICAgICAgPGZvOmJsb2NrIGxpbmVmZWVkLXRyZWF0 bWVudD0iaWdub3JlIj4uLi4uLi4uLi4uLg0KCSAgPGZvOmlubGluZT4NCgkgIEhJIFRIRVJFDQoJ ICA8L2ZvOmlubGluZT4NCgkgIC4uLi4uLi4uLi4uLi4uDQoJICA8L2ZvOmJsb2NrPg0KICAgIDwv Zm86Zmxvdz4NCiAgPC9mbzpwYWdlLXNlcXVlbmNlPg0KPC9mbzpyb290Pg0K --------_445074DFC0B304DEC008_MULTIPART_MIXED_--