Hi Vincent,

I've been thinking about the tableCaption() call: this doesn't solve the problem. The pdf generation will still fail if a specific parser emits the tableCaption within the table. This is currently still the case in particular for the AptParser, whose behavior the SinkTestDocument is supposed to mimick. As long as we don't have a mechanism to enforce the order of parsing events (see DOXIA-132), any sink must be flexible enough to deal with any (reasonable) order of events. In the current case, the ItextSink has to cache the tableCaption while it is parsed and emit it only at the end of the table.

Even though it doesn't really matter where the caption is emitted (as long as it's the same for all parsers), I think it's more logical within the table, since in general a tableCaption is part of a table (just not for itext, nor for fo btw).

I'll test and provide a fix soon.

-Lukas


[EMAIL PROTECTED] wrote:
Author: vsiveton
Date: Fri Aug 17 22:10:45 2007
New Revision: 567233

URL: http://svn.apache.org/viewvc?view=rev&rev=567233
Log:
o fixed tableCaption() call
o used the UTF-8 charset for the copyright (safety)

Modified:
    
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java

Modified: 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java
URL: 
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java?view=diff&rev=567233&r1=567232&r2=567233
==============================================================================
--- 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java
 (original)
+++ 
maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkTestDocument.java
 Fri Aug 17 22:10:45 2007
@@ -19,6 +19,8 @@
  * under the License.
  */
+import java.io.UnsupportedEncodingException;
+
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.sink.Sink;
@@ -365,11 +367,11 @@ sink.tableRows_(); + sink.table_();
+
         sink.tableCaption();
         sink.text( "Table caption" );
         sink.tableCaption_();
-
-        sink.table_();
     }
/**
@@ -595,10 +597,17 @@
         sink.paragraph_();
sink.paragraph();
-        String copyright = String.valueOf( '\u00a9' );
+        String copyright;
+        try
+        {
+            copyright = new String( String.valueOf( '\u00a9' ).getBytes( 
"UTF-8" ) );
+        }
+        catch ( UnsupportedEncodingException e )
+        {
+            throw new IllegalArgumentException( e.getMessage() );
+        }
         sink.text( "Copyright symbol: " + copyright + ", "
             + copyright + ", " + copyright + "." );
         sink.paragraph_();
     }
-
 }

Reply via email to