maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r577694 - in /maven/sandbox/trunk/doxia/doxia-module-fo: ./ src/main/java/org/apache/maven/doxia/module/fo/ src/test/java/org/apache/maven/doxia/module/fo/
Date Thu, 20 Sep 2007 11:40:51 GMT
Author: ltheussl
Date: Thu Sep 20 04:40:50 2007
New Revision: 577694

URL: http://svn.apache.org/viewvc?rev=577694&view=rev
Log:
Use new Markup infrastrucure

Added:
    maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoMarkup.java   (with props)
Modified:
    maven/sandbox/trunk/doxia/doxia-module-fo/pom.xml
    maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
    maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
    maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
    maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoConfigurationTest.java
    maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java

Modified: maven/sandbox/trunk/doxia/doxia-module-fo/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/pom.xml?rev=577694&r1=577693&r2=577694&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-module-fo/pom.xml (original)
+++ maven/sandbox/trunk/doxia/doxia-module-fo/pom.xml Thu Sep 20 04:40:50 2007
@@ -31,7 +31,7 @@
   <name>Doxia :: FO Module</name>
 
   <properties>
-    <doxiaVersion>1.0-alpha-9</doxiaVersion>
+    <doxiaVersion>1.0-beta-1-SNAPSHOT</doxiaVersion>
   </properties>
 
   <developers>

Modified: maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java?rev=577694&r1=577693&r2=577694&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java (original)
+++ maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java Thu Sep 20 04:40:50 2007
@@ -23,6 +23,8 @@
 
 import java.util.Iterator;
 
+import javax.swing.text.html.HTML.Tag;
+
 import org.apache.maven.doxia.docrenderer.document.DocumentMeta;
 import org.apache.maven.doxia.docrenderer.document.DocumentTOC;
 import org.apache.maven.doxia.docrenderer.document.DocumentTOCItem;
@@ -120,7 +122,7 @@
         }
         else
         {
-            writeStartTag( "block", "id", docName );
+            writeStartTag( BLOCK_TAG, "id", docName );
         }
 
     }
@@ -129,9 +131,9 @@
     public void body_()
     {
         newline();
-        writeEndTag( "block" );
-        writeEndTag( "flow" );
-        writeEndTag( "page-sequence" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( FLOW_TAG );
+        writeEndTag( PAGE_SEQUENCE_TAG );
 
         // reset document name
         docName = null;
@@ -214,7 +216,7 @@
             anchor = docName + anchor;
         }
 
-        writeStartTag( "inline", "id", anchor );
+        writeStartTag( INLINE_TAG, "id", anchor );
     }
 
 
@@ -225,8 +227,8 @@
             || name.startsWith( "ftp" ) )
         {
             // external links
-            writeStartTag( "basic-link", "external-destination", HtmlTools.escapeHTML( name ) );
-            writeStartTag( "inline", "href.external" );
+            writeStartTag( BASIC_LINK_TAG, "external-destination", HtmlTools.escapeHTML( name ) );
+            writeStartTag( INLINE_TAG, "href.external" );
         }
         else if ( name.startsWith( "./" ) )
         {
@@ -262,8 +264,8 @@
                 }
             }
 
-            writeStartTag( "basic-link", "internal-destination", HtmlTools.escapeHTML( anchor ) );
-            writeStartTag( "inline", "href.internal" );
+            writeStartTag( BASIC_LINK_TAG, "internal-destination", HtmlTools.escapeHTML( anchor ) );
+            writeStartTag( INLINE_TAG, "href.internal" );
         }
         else if ( name.startsWith( "../" ) )
         {
@@ -275,8 +277,8 @@
             if ( docName == null )
             {
                 // can't resolve link without base, fop will issue a warning
-                writeStartTag( "basic-link", "internal-destination", HtmlTools.escapeHTML( anchor ) );
-                writeStartTag( "inline", "href.internal" );
+                writeStartTag( BASIC_LINK_TAG, "internal-destination", HtmlTools.escapeHTML( anchor ) );
+                writeStartTag( INLINE_TAG, "href.internal" );
 
                 return;
             }
@@ -313,8 +315,8 @@
                 anchor = docName + anchor;
             }
 
-            writeStartTag( "basic-link", "internal-destination", HtmlTools.escapeHTML( anchor ) );
-            writeStartTag( "inline", "href.internal" );
+            writeStartTag( BASIC_LINK_TAG, "internal-destination", HtmlTools.escapeHTML( anchor ) );
+            writeStartTag( INLINE_TAG, "href.internal" );
         }
     }
 
@@ -326,10 +328,10 @@
     /**
      * Writes a start tag, prepending EOL.
      *
-     * @param tag The tag name.
+     * @param tag The tag.
      * @param attributeId An id identifying the attribute set.
      */
-    protected void writeStartTag( String tag, String attributeId )
+    protected void writeStartTag( Tag tag, String attributeId )
     {
         if ( !ignoreText )
         {
@@ -340,11 +342,11 @@
     /**
      * Writes a start tag, prepending EOL.
      *
-     * @param tag The tag name.
+     * @param tag The tag.
      * @param id An id to add.
      * @param name The name (value) of the id.
      */
-    protected void writeStartTag( String tag, String id, String name )
+    protected void writeStartTag( Tag tag, String id, String name )
     {
         if ( !ignoreText )
         {
@@ -355,9 +357,9 @@
     /**
      * Writes an end tag, appending EOL.
      *
-     * @param tag The tag name.
+     * @param tag The tag.
      */
-    protected void writeEndTag( String tag )
+    protected void writeEndTag( Tag tag )
     {
         if ( !ignoreText )
         {
@@ -368,10 +370,10 @@
     /**
      * Writes a simple tag, appending EOL.
      *
-     * @param tag The tag name.
+     * @param tag The tag.
      * @param attributeId An id identifying the attribute set.
      */
-    protected void writeEmptyTag( String tag, String attributeId )
+    protected void writeEmptyTag( Tag tag, String attributeId )
     {
         if ( !ignoreText )
         {
@@ -483,31 +485,31 @@
      */
     protected void regionBefore( String headerText )
     {
-        writeStartTag( "static-content", "flow-name", "xsl-region-before" );
+        writeStartTag( STATIC_CONTENT_TAG, "flow-name", "xsl-region-before" );
         writeln( "<fo:table table-layout=\"fixed\" width=\"100%\" >" );
-        writeEmptyTag( "table-column", "column-width", "5.625in" );
-        writeEmptyTag( "table-column", "column-width", "0.625in" );
-        writeStartTag( "table-body", null );
-        writeStartTag( "table-row", null );
-        writeStartTag( "table-cell", null );
-        writeStartTag( "block", "header.style" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "5.625in" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "0.625in" );
+        writeStartTag( TABLE_BODY_TAG, "" );
+        writeStartTag( TABLE_ROW_TAG, "" );
+        writeStartTag( TABLE_CELL_TAG, "" );
+        writeStartTag( BLOCK_TAG, "header.style" );
 
         if ( headerText != null )
         {
             write( headerText );
         }
 
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
-        writeStartTag( "table-cell", null );
-        writeStartTag( "block", "page.number" );
-        writeEmptyTag( "page-number", null );
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
-        writeEndTag( "table-body" );
-        writeEndTag( "table" );
-        writeEndTag( "static-content" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
+        writeStartTag( TABLE_CELL_TAG, "" );
+        writeStartTag( BLOCK_TAG, "page.number" );
+        writeEmptyTag( PAGE_NUMBER_TAG, "" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
+        writeEndTag( TABLE_BODY_TAG );
+        writeEndTag( TABLE_TAG );
+        writeEndTag( STATIC_CONTENT_TAG );
     }
 
     /**
@@ -517,16 +519,16 @@
      */
     protected void regionAfter( String footerText )
     {
-        writeStartTag( "static-content", "flow-name", "xsl-region-after" );
-        writeStartTag( "block", "footer.style" );
+        writeStartTag( STATIC_CONTENT_TAG, "flow-name", "xsl-region-after" );
+        writeStartTag( BLOCK_TAG, "footer.style" );
 
         if ( footerText != null )
         {
             write( footerText );
         }
 
-        writeEndTag( "block" );
-        writeEndTag( "static-content" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( STATIC_CONTENT_TAG );
     }
 
     /**
@@ -537,21 +539,21 @@
      */
     protected void chapterHeading( String headerText, boolean chapterNumber )
     {
-        writeStartTag( "block", null );
-        writeStartTag( "list-block", null );
-        writeStartTag( "list-item", null );
+        writeStartTag( BLOCK_TAG, "" );
+        writeStartTag( LIST_BLOCK_TAG, "" );
+        writeStartTag( LIST_ITEM_TAG, "" );
         writeln( "<fo:list-item-label end-indent=\"6.375in\" start-indent=\"-1in\">" );
-        writeStartTag( "block", "outdented.number.style" );
+        writeStartTag( BLOCK_TAG, "outdented.number.style" );
 
         if ( chapterNumber )
         {
             write( Integer.toString( chapter ) );
         }
 
-        writeEndTag( "block" );
-        writeEndTag( "list-item-label" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( LIST_ITEM_LABEL_TAG );
         writeln( "<fo:list-item-body end-indent=\"1in\" start-indent=\"0in\">" );
-        writeStartTag( "block", "chapter.title" );
+        writeStartTag( BLOCK_TAG, "chapter.title" );
 
         if ( headerText == null )
         {
@@ -562,14 +564,14 @@
             write( headerText );
         }
 
-        writeEndTag( "block" );
-        writeEndTag( "list-item-body" );
-        writeEndTag( "list-item" );
-        writeEndTag( "list-block" );
-        writeEndTag( "block" );
-        writeStartTag( "block", "space-after.optimum", "0em" );
-        writeEmptyTag( "leader", "chapter.rule" );
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( LIST_ITEM_BODY_TAG );
+        writeEndTag( LIST_ITEM_TAG );
+        writeEndTag( LIST_BLOCK_TAG );
+        writeEndTag( BLOCK_TAG );
+        writeStartTag( BLOCK_TAG, "space-after.optimum", "0em" );
+        writeEmptyTag( LEADER_TAG, "chapter.rule" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /**
@@ -582,14 +584,14 @@
         writeln( "<fo:page-sequence master-reference=\"toc\" initial-page-number=\"1\" format=\"i\">" );
         regionBefore( toc.getName() );
         regionAfter( getFooterText() );
-        writeStartTag( "flow", "flow-name", "xsl-region-body" );
+        writeStartTag( FLOW_TAG, "flow-name", "xsl-region-body" );
         chapterHeading( toc.getName(), false );
         writeln( "<fo:table table-layout=\"fixed\" width=\"100%\" >" );
-        writeEmptyTag( "table-column", "column-width", "0.45in" );
-        writeEmptyTag( "table-column", "column-width", "0.4in" );
-        writeEmptyTag( "table-column", "column-width", "0.4in" );
-        writeEmptyTag( "table-column", "column-width", "5in" ); // TODO
-        writeStartTag( "table-body", null );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "0.45in" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "0.4in" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "0.4in" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "5in" ); // TODO
+        writeStartTag( TABLE_BODY_TAG, "" );
 
         int count = 0;
 
@@ -600,31 +602,31 @@
 
             String ref = getIdName( tocItem.getRef() );
 
-            writeStartTag( "table-row", "keep-with-next", "always" );
-            writeStartTag( "table-cell", "toc.cell" );
-            writeStartTag( "block", "toc.number.style" );
+            writeStartTag( TABLE_ROW_TAG, "keep-with-next", "always" );
+            writeStartTag( TABLE_CELL_TAG, "toc.cell" );
+            writeStartTag( BLOCK_TAG, "toc.number.style" );
             write( Integer.toString( count ) );
-            writeEndTag( "block" );
-            writeEndTag( "table-cell" );
-            writeStartTag( "table-cell", "number-columns-spanned", "3", "toc.cell" );
-            // TODO: writeStartTag( "block", "text-align-last", "justify", "toc.h1.style" );
-            writeStartTag( "block", "toc.h1.style" );
-            writeStartTag( "basic-link", "internal-destination", ref );
+            writeEndTag( BLOCK_TAG );
+            writeEndTag( TABLE_CELL_TAG );
+            writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "3", "toc.cell" );
+            // TODO: writeStartTag( BLOCK_TAG, "text-align-last", "justify", "toc.h1.style" );
+            writeStartTag( BLOCK_TAG, "toc.h1.style" );
+            writeStartTag( BASIC_LINK_TAG, "internal-destination", ref );
             write( tocItem.getName() );
-            writeEndTag( "basic-link" );
-            writeEmptyTag( "leader", "toc.leader.style" );
-            writeStartTag( "inline", "page.number" );
-            writeEmptyTag( "page-number-citation", "ref-id", ref );
-            writeEndTag( "inline" );
-            writeEndTag( "block" );
-            writeEndTag( "table-cell" );
-            writeEndTag( "table-row" );
+            writeEndTag( BASIC_LINK_TAG );
+            writeEmptyTag( LEADER_TAG, "toc.leader.style" );
+            writeStartTag( INLINE_TAG, "page.number" );
+            writeEmptyTag( PAGE_NUMBER_CITATION_TAG, "ref-id", ref );
+            writeEndTag( INLINE_TAG );
+            writeEndTag( BLOCK_TAG );
+            writeEndTag( TABLE_CELL_TAG );
+            writeEndTag( TABLE_ROW_TAG );
         }
 
-        writeEndTag( "table-body" );
-        writeEndTag( "table" );
-        writeEndTag( "flow" );
-        writeEndTag( "page-sequence" );
+        writeEndTag( TABLE_BODY_TAG );
+        writeEndTag( TABLE_TAG );
+        writeEndTag( FLOW_TAG );
+        writeEndTag( PAGE_SEQUENCE_TAG );
 
 
     }
@@ -641,117 +643,117 @@
 
         // TODO: remove hard-coded settings
 
-        writeStartTag( "page-sequence", "master-reference", "cover-page" );
-        writeStartTag( "flow", "flow-name", "xsl-region-body" );
-        writeStartTag( "block", "text-align", "center" );
-        //writeStartTag( "table", "table-layout", "fixed" );
+        writeStartTag( PAGE_SEQUENCE_TAG, "master-reference", "cover-page" );
+        writeStartTag( FLOW_TAG, "flow-name", "xsl-region-body" );
+        writeStartTag( BLOCK_TAG, "text-align", "center" );
+        //writeStartTag( TABLE_TAG, "table-layout", "fixed" );
         writeln( "<fo:table table-layout=\"fixed\" width=\"100%\" >" );
-        writeEmptyTag( "table-column", "column-width", "3.125in" );
-        writeEmptyTag( "table-column", "column-width", "3.125in" );
-        writeStartTag( "table-body", null );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "3.125in" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "3.125in" );
+        writeStartTag( TABLE_BODY_TAG, "" );
 
-        writeStartTag( "table-row", "height", "1.5in" );
-        writeStartTag( "table-cell", null );
+        writeStartTag( TABLE_ROW_TAG, "height", "1.5in" );
+        writeStartTag( TABLE_CELL_TAG, "" );
         // TODO: companyLogo
-        writeEmptyTag( "block", null );
-        writeEndTag( "table-cell" );
-        writeStartTag( "table-cell", null );
+        writeEmptyTag( BLOCK_TAG, "" );
+        writeEndTag( TABLE_CELL_TAG );
+        writeStartTag( TABLE_CELL_TAG, "" );
         // TODO: projectLogo
-        writeEmptyTag( "block", null );
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
+        writeEmptyTag( BLOCK_TAG, "" );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
 
         writeln( "<fo:table-row keep-with-previous=\"always\" height=\"0.014in\">" );
-        writeStartTag( "table-cell", "number-columns-spanned", "2" );
-        writeStartTag( "block", "line-height", "0.014in" );
-        writeEmptyTag( "leader", "chapter.rule" );
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
-
-        writeStartTag( "table-row", "height", "7.447in" );
-        writeStartTag( "table-cell", "number-columns-spanned", "2" );
-        //writeStartTag( "table", "table-layout", "fixed" );
+        writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "2" );
+        writeStartTag( BLOCK_TAG, "line-height", "0.014in" );
+        writeEmptyTag( LEADER_TAG, "chapter.rule" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
+
+        writeStartTag( TABLE_ROW_TAG, "height", "7.447in" );
+        writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "2" );
+        //writeStartTag( TABLE_TAG, "table-layout", "fixed" );
         writeln( "<fo:table table-layout=\"fixed\" width=\"100%\" >" );
-        writeEmptyTag( "table-column", "column-width", "2.083in" );
-        writeEmptyTag( "table-column", "column-width", "2.083in" );
-        writeEmptyTag( "table-column", "column-width", "2.083in" );
-
-        writeStartTag( "table-body", null );
-
-        writeStartTag( "table-row", null );
-        writeStartTag( "table-cell", "number-columns-spanned", "3" );
-        writeEmptyTag( "block", null );
-        writeEmptyTag( "block", "space-before", "3.2235in" );
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
-
-        writeStartTag( "table-row", null );
-        writeStartTag( "table-cell", null );
-        writeEmptyTag( "block", "space-after", "0.5in" );
-        writeEndTag( "table-cell" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "2.083in" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "2.083in" );
+        writeEmptyTag( TABLE_COLUMN_TAG, "column-width", "2.083in" );
+
+        writeStartTag( TABLE_BODY_TAG, "" );
+
+        writeStartTag( TABLE_ROW_TAG, "" );
+        writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "3" );
+        writeEmptyTag( BLOCK_TAG, "" );
+        writeEmptyTag( BLOCK_TAG, "space-before", "3.2235in" );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
+
+        writeStartTag( TABLE_ROW_TAG, "" );
+        writeStartTag( TABLE_CELL_TAG, "" );
+        writeEmptyTag( BLOCK_TAG, "space-after", "0.5in" );
+        writeEndTag( TABLE_CELL_TAG );
 
-        writeStartTag( "table-cell", "number-columns-spanned", "2", "cover.border.left" );
-        writeStartTag( "block", "cover.title" );
+        writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "2", "cover.border.left" );
+        writeStartTag( BLOCK_TAG, "cover.title" );
         write( title );
         // TODO: version
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
-
-        writeStartTag( "table-row", null );
-        writeStartTag( "table-cell", null );
-        writeEmptyTag( "block", null );
-        writeEndTag( "table-cell" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
+
+        writeStartTag( TABLE_ROW_TAG, "" );
+        writeStartTag( TABLE_CELL_TAG, "" );
+        writeEmptyTag( BLOCK_TAG, "" );
+        writeEndTag( TABLE_CELL_TAG );
 
 
-        writeStartTag( "table-cell", "number-columns-spanned", "2", "cover.border.left.bottom" );
-        writeStartTag( "block", "cover.subtitle" );
+        writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "2", "cover.border.left.bottom" );
+        writeStartTag( BLOCK_TAG, "cover.subtitle" );
         // TODO: sub title (cover type)
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
 
-        writeEndTag( "table-body" );
-        writeEndTag( "table" );
+        writeEndTag( TABLE_BODY_TAG );
+        writeEndTag( TABLE_TAG );
 
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
 
-        writeStartTag( "table-row", "height", "0.014in" );
-        writeStartTag( "table-cell", "number-columns-spanned", "2" );
+        writeStartTag( TABLE_ROW_TAG, "height", "0.014in" );
+        writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "2" );
         writeln( "<fo:block space-after=\"0.2in\" line-height=\"0.014in\">" );
-        writeEmptyTag( "leader", "chapter.rule" );
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
-
-        writeStartTag( "table-row", null );
-        writeStartTag( "table-cell", "number-columns-spanned", "2" );
-        writeEmptyTag( "block", null );
-        writeEmptyTag( "block", "space-before", "0.2in" );
-        writeEndTag( "table-cell" );
-        writeEndTag( "table-row" );
-
-        writeStartTag( "table-row", "height", "0.3in" );
-        writeStartTag( "table-cell", null );
-        writeStartTag( "block", "height", "0.3in", "cover.subtitle" );
+        writeEmptyTag( LEADER_TAG, "chapter.rule" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
+
+        writeStartTag( TABLE_ROW_TAG, "" );
+        writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "2" );
+        writeEmptyTag( BLOCK_TAG, "" );
+        writeEmptyTag( BLOCK_TAG, "space-before", "0.2in" );
+        writeEndTag( TABLE_CELL_TAG );
+        writeEndTag( TABLE_ROW_TAG );
+
+        writeStartTag( TABLE_ROW_TAG, "height", "0.3in" );
+        writeStartTag( TABLE_CELL_TAG, "" );
+        writeStartTag( BLOCK_TAG, "height", "0.3in", "cover.subtitle" );
         write( author );
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
 
-        writeStartTag( "table-cell", null );
-        writeStartTag( "block", "height", "0.3in", "cover.subtitle" );
+        writeStartTag( TABLE_CELL_TAG, "" );
+        writeStartTag( BLOCK_TAG, "height", "0.3in", "cover.subtitle" );
         // TODO: date
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
 
-        writeEndTag( "table-row" );
-        writeEndTag( "table-body" );
-        writeEndTag( "table" );
-        writeEndTag( "block" );
-        writeEndTag( "flow" );
-        writeEndTag( "page-sequence" );
+        writeEndTag( TABLE_ROW_TAG );
+        writeEndTag( TABLE_BODY_TAG );
+        writeEndTag( TABLE_TAG );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( FLOW_TAG );
+        writeEndTag( PAGE_SEQUENCE_TAG );
     }
 
 }

Modified: maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java?rev=577694&r1=577693&r2=577694&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java (original)
+++ maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java Thu Sep 20 04:40:50 2007
@@ -21,18 +21,21 @@
 
 import java.util.List;
 
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.XMLConfiguration;
 
+import org.apache.maven.doxia.sink.AbstractXmlSink;
 
 /**
  * A utility class to construct FO configuration parameters.
  */
 public class FoConfiguration
 {
-
     /** Holds the single attributes. */
-    private StringBuffer buffer;
+    private MutableAttributeSet attributeSet;
 
     /** The configuration instance. */
     private final XMLConfiguration config;
@@ -76,7 +79,7 @@
      * empty string if attributeId is null or if attributeId
      * is not a valid identifier.
      */
-    public String getAttributeSet( String attributeId )
+    public String getAttributeString( String attributeId )
     {
         if ( attributeId == null )
         {
@@ -85,7 +88,36 @@
 
         reset();
         addAttributes( attributeId );
-        return buffer.toString();
+
+        return AbstractXmlSink.getAttributeString( attributeSet );
+    }
+
+    /**
+     * Builds a set of attributes.
+     *
+     * @param attributeId A unique id to identify the set of attributes.
+     * This should correspond to the name of an attribute-set
+     * defined in the configuration file.
+     * @return A MutableAttributeSet that contains the attributes with
+     * the values configured for the current builder. Returns null
+     * if attributeId is null or empty, or if attributeId is not a valid identifier.
+     */
+    public MutableAttributeSet getAttributeSet( String attributeId )
+    {
+        if ( attributeId == null || attributeId.length() == 0 )
+        {
+            return null;
+        }
+
+        reset();
+        addAttributes( attributeId );
+
+        if ( attributeSet.getAttributeCount() == 0 )
+        {
+            return null;
+        }
+
+        return attributeSet;
     }
 
     /**
@@ -107,14 +139,14 @@
             List keys = config.getList( keybase + ".xsl:attribute[@name]" );
             for ( int i = 0; i < values.size(); i++ )
             {
-                buffer.append( " " + keys.get( i ) + "=\"" + values.get( i ) + "\"" );
+                attributeSet.addAttribute( keys.get( i ), values.get( i ) );
             }
         }
         else if ( prop instanceof String )
         {
             String value = config.getString( keybase + ".xsl:attribute" );
             String key = config.getString( keybase + ".xsl:attribute[@name]" );
-            buffer.append( " " + key + "=\"" + value + "\"" );
+            attributeSet.addAttribute( key, value );
         }
 
         String extend = config.getString( keybase + "[@use-attribute-sets]" );
@@ -125,11 +157,11 @@
     }
 
     /**
-     * Re-initialize the StringBuffer.
+     * (Re-)initialize the AttributeSet.
      */
     private void reset()
     {
-        this.buffer = new StringBuffer( 512 );
+        this.attributeSet = new SimpleAttributeSet();
     }
 
 }

Added: maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoMarkup.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoMarkup.java?rev=577694&view=auto
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoMarkup.java (added)
+++ maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoMarkup.java Thu Sep 20 04:40:50 2007
@@ -0,0 +1,301 @@
+package org.apache.maven.doxia.module.fo;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.swing.text.html.HTML.Tag;
+
+import org.apache.maven.doxia.markup.XmlMarkup;
+
+/**
+ * List of <code>FO</code> markups.
+ *
+ * @author ltheussl
+ * @version $Id$
+ * @since 1.0
+ */
+public interface FoMarkup
+    extends XmlMarkup
+{
+    // ----------------------------------------------------------------------
+    // Specific FO tags
+    // ----------------------------------------------------------------------
+
+    /** FO tag for <code>root</code>. */
+    Tag ROOT_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "root";
+        }
+    };
+
+    /** FO tag for <code>layout-master-set</code>. */
+    Tag LAYOUT_MASTER_SET_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "layout-master-set";
+        }
+    };
+
+    /** FO tag for <code>simple-page-master</code>. */
+    Tag SIMPLE_PAGE_MASTER_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "simple-page-master";
+        }
+    };
+
+    /** FO tag for <code>region-body</code>. */
+    Tag REGION_BODY_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "region-body";
+        }
+    };
+
+    /** FO tag for <code>region-before</code>. */
+    Tag REGION_BEFORE_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "region-before";
+        }
+    };
+
+    /** FO tag for <code>region-after</code>. */
+    Tag REGION_AFTER_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "region-after";
+        }
+    };
+
+    /** FO tag for <code>static-content</code>. */
+    Tag STATIC_CONTENT_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "static-content";
+        }
+    };
+
+
+    /** FO tag for <code>page-sequence</code>. */
+    Tag PAGE_SEQUENCE_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "page-sequence";
+        }
+    };
+
+    /** FO tag for <code>flow</code>. */
+    Tag FLOW_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "flow";
+        }
+    };
+
+    /** FO tag for <code>block</code>. */
+    Tag BLOCK_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "block";
+        }
+    };
+
+    /** FO tag for <code>list-block</code>. */
+    Tag LIST_BLOCK_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "list-block";
+        }
+    };
+
+    /** FO tag for <code>list-item</code>. */
+    Tag LIST_ITEM_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "list-item";
+        }
+    };
+
+    /** FO tag for <code>list-item-body</code>. */
+    Tag LIST_ITEM_BODY_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "list-item-body";
+        }
+    };
+
+    /** FO tag for <code>list-item-label</code>. */
+    Tag LIST_ITEM_LABEL_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "list-item-label";
+        }
+    };
+
+    /** FO tag for <code>table-and-caption</code>. */
+    Tag TABLE_AND_CAPTION_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "table-and-caption";
+        }
+    };
+
+    /** FO tag for <code>table</code>. */
+    Tag TABLE_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "table";
+        }
+    };
+
+    /** FO tag for <code>table-body</code>. */
+    Tag TABLE_BODY_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "table-body";
+        }
+    };
+
+    /** FO tag for <code>table-column</code>. */
+    Tag TABLE_COLUMN_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "table-column";
+        }
+    };
+
+    /** FO tag for <code>table-row</code>. */
+    Tag TABLE_ROW_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "table-row";
+        }
+    };
+
+    /** FO tag for <code>table-cell</code>. */
+    Tag TABLE_CELL_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "table-cell";
+        }
+    };
+
+    /** FO tag for <code>table-caption</code>. */
+    Tag TABLE_CAPTION_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "table-caption";
+        }
+    };
+
+    /** FO tag for <code>inline</code>. */
+    Tag INLINE_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "inline";
+        }
+    };
+
+    /** FO tag for <code>basic-link</code>. */
+    Tag BASIC_LINK_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "basic-link";
+        }
+    };
+
+    /** FO tag for <code>leader</code>. */
+    Tag LEADER_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "leader";
+        }
+    };
+
+    /** FO tag for <code>page-number</code>. */
+    Tag PAGE_NUMBER_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "page-number";
+        }
+    };
+
+    /** FO tag for <code>page-number-citation</code>. */
+    Tag PAGE_NUMBER_CITATION_TAG = new Tag()
+    {
+        /** {@inheritDoc} */
+        public String toString()
+        {
+            return "page-number-citation";
+        }
+    };
+
+}

Propchange: maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoMarkup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoMarkup.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java?rev=577694&r1=577693&r2=577694&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java (original)
+++ maven/sandbox/trunk/doxia/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java Thu Sep 20 04:40:50 2007
@@ -23,6 +23,11 @@
 import java.io.Writer;
 import java.util.Stack;
 
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+import javax.swing.text.html.HTML.Tag;
+
+import org.apache.maven.doxia.sink.AbstractXmlSink;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.util.HtmlTools;
@@ -30,12 +35,10 @@
 /**
  * A Doxia Sink that produces a FO model.
  */
-public class FoSink implements Sink
+public class FoSink
+    extends AbstractXmlSink
+    implements FoMarkup
 {
-
-    /** System-dependent end-of-line string. */
-    private static final String EOL = System.getProperty( "line.separator" );
-
     /** For writing the result. */
     private final Writer out;
 
@@ -75,6 +78,8 @@
     {
         this.out = writer;
         this.config = new FoConfiguration();
+
+        setNameSpace( "fo" );
     }
 
     /**
@@ -105,37 +110,37 @@
     /** {@inheritDoc} */
     public void title()
     {
-        writeStartTag( "block", "doc.header.title" );
+        writeStartTag( BLOCK_TAG, "doc.header.title" );
     }
 
     /** {@inheritDoc} */
     public void title_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
     public void author()
     {
-        writeStartTag( "block", "doc.header.author" );
+        writeStartTag( BLOCK_TAG, "doc.header.author" );
     }
 
     /** {@inheritDoc} */
     public void author_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
     public void date()
     {
-        writeStartTag( "block", "doc.header.date" );
+        writeStartTag( BLOCK_TAG, "doc.header.date" );
     }
 
     /** {@inheritDoc} */
     public void date_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
@@ -148,8 +153,8 @@
     public void body_()
     {
         newline();
-        writeEndTag( "flow" );
-        writeEndTag( "page-sequence" );
+        writeEndTag( FLOW_TAG );
+        writeEndTag( PAGE_SEQUENCE_TAG );
         endDocument();
     }
 
@@ -299,7 +304,7 @@
     private void onSection()
     {
         newline();
-        writeStartTag( "block", "body.text" );
+        writeStartTag( BLOCK_TAG, "body.text" );
     }
 
     /**
@@ -316,29 +321,29 @@
         newline();
         if ( depth == Sink.SECTION_LEVEL_1 )
         {
-            writeStartTag( "block", "body.h1" );
+            writeStartTag( BLOCK_TAG, "body.h1" );
             title.append( section ).append( "   " );
         }
         else if ( depth == Sink.SECTION_LEVEL_2 )
         {
-            writeStartTag( "block", "body.h2" );
+            writeStartTag( BLOCK_TAG, "body.h2" );
             title.append( section ).append( "." );
             title.append( subsection ).append( "   " );
         }
         else if ( depth == Sink.SECTION_LEVEL_3 )
         {
-            writeStartTag( "block", "body.h3" );
+            writeStartTag( BLOCK_TAG, "body.h3" );
             title.append( section ).append( "." );
             title.append( subsection ).append( "." );
             title.append( subsubsection ).append( "   " );
         }
         else if ( depth == Sink.SECTION_LEVEL_4 )
         {
-            writeStartTag( "block", "body.h4" );
+            writeStartTag( BLOCK_TAG, "body.h4" );
         }
         else
         {
-            writeStartTag( "block", "body.h5" );
+            writeStartTag( BLOCK_TAG, "body.h5" );
         }
 
         write( title.toString() );
@@ -347,13 +352,13 @@
     /** Ends a section title. */
     private void onSectionTitle_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** Ends a section/subsection. */
     private void onSection_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /**
@@ -384,31 +389,31 @@
     public void list()
     {
         newline();
-        writeStartTag( "list-block", "list" );
+        writeStartTag( LIST_BLOCK_TAG, "list" );
     }
 
     /** {@inheritDoc} */
     public void list_()
     {
-        writeEndTag( "list-block" );
+        writeEndTag( LIST_BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
     public void listItem()
     {
-        writeStartTag( "list-item", "list.item" );
+        writeStartTag( LIST_ITEM_TAG, "list.item" );
         // TODO customize?
         writeln( "<fo:list-item-label><fo:block>&#8226;</fo:block></fo:list-item-label>" );
-        writeStartTag( "list-item-body", "list.item" );
-        writeStartTag( "block", null );
+        writeStartTag( LIST_ITEM_BODY_TAG, "list.item" );
+        writeStartTag( BLOCK_TAG, "" );
     }
 
     /** {@inheritDoc} */
     public void listItem_()
     {
-        writeEndTag( "block" );
-        writeEndTag( "list-item-body" );
-        writeEndTag( "list-item" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( LIST_ITEM_BODY_TAG );
+        writeEndTag( LIST_ITEM_TAG );
     }
 
     /** {@inheritDoc} */
@@ -416,14 +421,14 @@
     {
         listStack.push( new NumberedListItem( numbering ) );
         newline();
-        writeStartTag( "list-block", "list" );
+        writeStartTag( LIST_BLOCK_TAG, "list" );
     }
 
     /** {@inheritDoc} */
     public void numberedList_()
     {
         listStack.pop();
-        writeEndTag( "list-block" );
+        writeEndTag( LIST_BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
@@ -432,37 +437,37 @@
         NumberedListItem current = (NumberedListItem) listStack.peek();
         current.next();
 
-        writeStartTag( "list-item", "list.item" );
+        writeStartTag( LIST_ITEM_TAG, "list.item" );
 
-        writeStartTag( "list-item-label", null );
-        writeStartTag( "block", null );
+        writeStartTag( LIST_ITEM_LABEL_TAG, "" );
+        writeStartTag( BLOCK_TAG, "" );
         write( current.getListItemSymbol() );
-        writeEndTag( "block" );
-        writeEndTag( "list-item-label" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( LIST_ITEM_LABEL_TAG );
 
-        writeStartTag( "list-item-body", "list.item" );
-        writeStartTag( "block", null );
+        writeStartTag( LIST_ITEM_BODY_TAG, "list.item" );
+        writeStartTag( BLOCK_TAG, "" );
     }
 
     /** {@inheritDoc} */
     public void numberedListItem_()
     {
-        writeEndTag( "block" );
-        writeEndTag( "list-item-body" );
-        writeEndTag( "list-item" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( LIST_ITEM_BODY_TAG );
+        writeEndTag( LIST_ITEM_TAG );
     }
 
     /** {@inheritDoc} */
     public void definitionList()
     {
         newline();
-        writeStartTag( "block", "dl" );
+        writeStartTag( BLOCK_TAG, "dl" );
     }
 
     /** {@inheritDoc} */
     public void definitionList_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
@@ -480,41 +485,41 @@
     /** {@inheritDoc} */
     public void definedTerm()
     {
-        writeStartTag( "block", "dt" );
+        writeStartTag( BLOCK_TAG, "dt" );
     }
 
     /** {@inheritDoc} */
     public void definedTerm_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
     public void definition()
     {
         newline();
-        writeStartTag( "block", "dd" );
+        writeStartTag( BLOCK_TAG, "dd" );
     }
 
     /** {@inheritDoc} */
     public void definition_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
     public void figure()
     {
         newline();
-        writeStartTag( "block", "figure.display" );
+        writeStartTag( BLOCK_TAG, "figure.display" );
         write( "<fo:external-graphic"
-            + config.getAttributeSet( "figure.graphics" ) );
+            + config.getAttributeString( "figure.graphics" ) );
     }
 
     /** {@inheritDoc} */
     public void figure_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
@@ -527,25 +532,25 @@
     /** {@inheritDoc} */
     public void figureCaption()
     {
-        writeStartTag( "block", "figure.caption" );
+        writeStartTag( BLOCK_TAG, "figure.caption" );
     }
 
     /** {@inheritDoc} */
     public void figureCaption_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
     public void paragraph()
     {
-        writeStartTag( "block", "normal.paragraph" );
+        writeStartTag( BLOCK_TAG, "normal.paragraph" );
     }
 
     /** {@inheritDoc} */
     public void paragraph_()
     {
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
@@ -554,11 +559,11 @@
         this.verbatim = true;
         if ( boxed )
         {
-            writeStartTag( "block", "body.source" );
+            writeStartTag( BLOCK_TAG, "body.source" );
         }
         else
         {
-            writeStartTag( "block", "body.pre" );
+            writeStartTag( BLOCK_TAG, "body.pre" );
         }
     }
 
@@ -566,45 +571,47 @@
     public void verbatim_()
     {
         this.verbatim = false;
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
     public void horizontalRule()
     {
         newline();
-        writeStartTag( "block", null );
-        writeEmptyTag( "leader", "body.rule" );
-        writeEndTag( "block" );
+        writeStartTag( BLOCK_TAG, "" );
+        writeEmptyTag( LEADER_TAG, "body.rule" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
     public void pageBreak()
     {
-        writeln( "<fo:block break-before=\"page\"/>" );
+        //writeln( "<fo:block break-before=\"page\"/>" );
+        writeEmptyTag( BLOCK_TAG, "break-before", "page" );
+        newline();
     }
 
     /** {@inheritDoc} */
     public void table()
     {
         newline();
-        writeStartTag( "block", "table.padding" );
+        writeStartTag( BLOCK_TAG, "table.padding" );
 
         // <fo:table-and-caption> is XSL-FO 1.0 standard but not implemented in FOP 0.93
-        //writeStartTag( "table-and-caption", null );
+        //writeStartTag( TABLE_AND_CAPTION_TAG, "" );
 
-        writeStartTag( "table", "table.layout" );
+        writeStartTag( TABLE_TAG, "table.layout" );
     }
 
     /** {@inheritDoc} */
     public void table_()
     {
-        writeEndTag( "table" );
+        writeEndTag( TABLE_TAG );
 
         // <fo:table-and-caption> is XSL-FO 1.0 standard but not implemented in FOP 0.93
-        //writeEndTag( "table-and-caption" );
+        //writeEndTag( TABLE_AND_CAPTION_TAG );
 
-        writeEndTag( "block" );
+        writeEndTag( BLOCK_TAG );
     }
 
     /** {@inheritDoc} */
@@ -624,28 +631,28 @@
         }
 
         writeln( "<fo:table-column column-width=\"proportional-column-width(1)\"/>" );
-        writeStartTag( "table-body", null );
+        writeStartTag( TABLE_BODY_TAG, "" );
     }
 
     /** {@inheritDoc} */
     public void tableRows_()
     {
         this.cellJustif = null;
-        writeEndTag( "table-body" );
+        writeEndTag( TABLE_BODY_TAG );
     }
 
     /** {@inheritDoc} */
     public void tableRow()
     {
         // TODO spacer rows
-        writeStartTag( "table-row", "table.body.row" );
+        writeStartTag( TABLE_ROW_TAG, "table.body.row" );
         this.cellCount = 0;
     }
 
     /** {@inheritDoc} */
     public void tableRow_()
     {
-        writeEndTag( "table-row" );
+        writeEndTag( TABLE_ROW_TAG );
     }
 
     /** {@inheritDoc} */
@@ -709,11 +716,11 @@
             {
                 write( " border-style=\"solid\" border-width=\"0.2mm\"" );
             }
-            writeln( config.getAttributeSet( "table.body.cell" ) + ">" );
+            writeln( config.getAttributeString( "table.body.cell" ) + ">" );
          }
          else
          {
-             writeStartTag( "table-cell", "table.body.cell" );
+             writeStartTag( TABLE_CELL_TAG, "table.body.cell" );
          }
         writeln( "<fo:block text-align=\"" + justif + "\">" );
     }
@@ -721,8 +728,8 @@
     /** {@inheritDoc} */
     public void tableCell_()
     {
-        writeEndTag( "block" );
-        writeEndTag( "table-cell" );
+        writeEndTag( BLOCK_TAG );
+        writeEndTag( TABLE_CELL_TAG );
         ++cellCount;
     }
 
@@ -736,7 +743,7 @@
     public void tableCaption()
     {
         // <fo:table-caption> is XSL-FO 1.0 standard but not implemented in FOP 0.93
-        //writeStartTag( "table-caption", null );
+        //writeStartTag( TABLE_CAPTION_TAG, "" );
 
         // TODO: how to implement this otherwise?
         // table-footer doesn't work because it has to be declared before table-body.
@@ -746,7 +753,7 @@
     public void tableCaption_()
     {
         // <fo:table-caption> is XSL-FO 1.0 standard but not implemented in FOP 0.93
-        //writeEndTag( "table-caption" );
+        //writeEndTag( TABLE_CAPTION_TAG );
     }
 
     /** {@inheritDoc} */
@@ -763,13 +770,13 @@
             anchor = "#" + HtmlTools.encodeId( anchor );
         }
 
-        writeStartTag( "inline", "id", anchor );
+        writeStartTag( INLINE_TAG, "id", anchor );
     }
 
     /** {@inheritDoc} */
     public void anchor_()
     {
-        writeEndTag( "inline" );
+        writeEndTag( INLINE_TAG );
     }
 
     /** {@inheritDoc} */
@@ -778,8 +785,8 @@
         if ( name.startsWith( "http" ) || name.startsWith( "mailto" )
             || name.startsWith( "ftp" ) )
         {
-            writeStartTag( "basic-link", "external-destination", HtmlTools.escapeHTML( name ) );
-            writeStartTag( "inline", "href.external" );
+            writeStartTag( BASIC_LINK_TAG, "external-destination", HtmlTools.escapeHTML( name ) );
+            writeStartTag( INLINE_TAG, "href.external" );
         }
         else
         {
@@ -796,59 +803,59 @@
                 anchor = "#" + HtmlTools.encodeId( anchor );
             }
 
-            writeStartTag( "basic-link", "internal-destination", HtmlTools.escapeHTML( anchor ) );
-            writeStartTag( "inline", "href.internal" );
+            writeStartTag( BASIC_LINK_TAG, "internal-destination", HtmlTools.escapeHTML( anchor ) );
+            writeStartTag( INLINE_TAG, "href.internal" );
         }
     }
 
     /** {@inheritDoc} */
     public void link_()
     {
-        writeEndTag( "inline" );
-        writeEndTag( "basic-link" );
+        writeEndTag( INLINE_TAG );
+        writeEndTag( BASIC_LINK_TAG );
     }
 
     /** {@inheritDoc} */
     public void italic()
     {
-        writeStartTag( "inline", "italic" );
+        writeStartTag( INLINE_TAG, "italic" );
     }
 
     /** {@inheritDoc} */
     public void italic_()
     {
-        writeEndTag( "inline" );
+        writeEndTag( INLINE_TAG );
     }
 
     /** {@inheritDoc} */
     public void bold()
     {
-        writeStartTag( "inline", "bold" );
+        writeStartTag( INLINE_TAG, "bold" );
     }
 
     /** {@inheritDoc} */
     public void bold_()
     {
-        writeEndTag( "inline" );
+        writeEndTag( INLINE_TAG );
     }
 
     /** {@inheritDoc} */
     public void monospaced()
     {
-        writeStartTag( "inline", "monospace" );
+        writeStartTag( INLINE_TAG, "monospace" );
     }
 
     /** {@inheritDoc} */
     public void monospaced_()
     {
-        writeEndTag( "inline" );
+        writeEndTag( INLINE_TAG );
     }
 
     /** {@inheritDoc} */
     public void lineBreak()
     {
         newline();
-            writeEmptyTag( "block", null );
+        writeEmptyTag( BLOCK_TAG, "" );
     }
 
     /** {@inheritDoc} */
@@ -902,27 +909,27 @@
     {
         writeln( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" );
 
-        writeln( "<fo:root xmlns:fo=\"http://www.w3.org/1999/XSL/Format\">" );
+        writeStartTag( ROOT_TAG, "xmlns:" + getNameSpace(), "http://www.w3.org/1999/XSL/Format" );
 
-        writeStartTag( "layout-master-set", null );
+        writeStartTag( LAYOUT_MASTER_SET_TAG, "" );
 
-        writeStartTag( "simple-page-master", "layout.master.set.cover-page" );
-        writeEmptyTag( "region-body", "layout.master.set.cover-page.region-body" );
-        writeEndTag( "simple-page-master" );
-
-        writeStartTag( "simple-page-master", "layout.master.set.toc" );
-        writeEmptyTag( "region-body", "layout.master.set.toc.region-body" );
-        writeEmptyTag( "region-before", "layout.master.set.toc.region-before" );
-        writeEmptyTag( "region-after", "layout.master.set.toc.region-after" );
-        writeEndTag( "simple-page-master" );
-
-        writeStartTag( "simple-page-master", "layout.master.set.body" );
-        writeEmptyTag( "region-body", "layout.master.set.body.region-body" );
-        writeEmptyTag( "region-before", "layout.master.set.body.region-before" );
-        writeEmptyTag( "region-after", "layout.master.set.body.region-after" );
-        writeEndTag( "simple-page-master" );
+        writeStartTag( SIMPLE_PAGE_MASTER_TAG, "layout.master.set.cover-page" );
+        writeEmptyTag( REGION_BODY_TAG, "layout.master.set.cover-page.region-body" );
+        writeEndTag( SIMPLE_PAGE_MASTER_TAG );
+
+        writeStartTag( SIMPLE_PAGE_MASTER_TAG, "layout.master.set.toc" );
+        writeEmptyTag( REGION_BODY_TAG, "layout.master.set.toc.region-body" );
+        writeEmptyTag( REGION_BEFORE_TAG, "layout.master.set.toc.region-before" );
+        writeEmptyTag( REGION_AFTER_TAG, "layout.master.set.toc.region-after" );
+        writeEndTag( SIMPLE_PAGE_MASTER_TAG );
+
+        writeStartTag( SIMPLE_PAGE_MASTER_TAG, "layout.master.set.body" );
+        writeEmptyTag( REGION_BODY_TAG, "layout.master.set.body.region-body" );
+        writeEmptyTag( REGION_BEFORE_TAG, "layout.master.set.body.region-before" );
+        writeEmptyTag( REGION_AFTER_TAG, "layout.master.set.body.region-after" );
+        writeEndTag( SIMPLE_PAGE_MASTER_TAG );
 
-        writeEndTag( "layout-master-set" );
+        writeEndTag( LAYOUT_MASTER_SET_TAG );
     }
 
     /**
@@ -930,7 +937,7 @@
      */
     public void endDocument()
     {
-        writeEndTag( "root" );
+        writeEndTag( ROOT_TAG );
         flush();
         close();
     }
@@ -942,68 +949,69 @@
     /**
      * Writes a start tag, prepending EOL.
      *
-     * @param tag The tag name.
+     * @param tag The tag.
      * @param attributeId An id identifying the attribute set.
      */
-    protected void writeStartTag( String tag, String attributeId )
+    protected void writeStartTag( Tag tag, String attributeId )
     {
-        String attribs = config.getAttributeSet( attributeId );
         newline();
-        write( "<fo:" + tag + attribs + ">" );
+        writeStartTag( tag, config.getAttributeSet( attributeId ) );
     }
 
     /**
      * Writes a start tag, prepending EOL.
      *
-     * @param tag The tag name.
+     * @param tag The tag.
      * @param id An id to add.
      * @param name The name (value) of the id.
      */
-    protected void writeStartTag( String tag, String id, String name )
+    protected void writeStartTag( Tag tag, String id, String name )
     {
         newline();
-        write( "<fo:" + tag + " " + id + "=\"" + name + "\">" );
+        MutableAttributeSet att = new SimpleAttributeSet();
+        att.addAttribute( id, name );
+
+        writeStartTag( tag, att );
     }
 
     /**
      * Writes a start tag, prepending EOL.
      *
-     * @param tag The tag name.
+     * @param tag The tag.
      * @param id An id to add.
      * @param name The name (value) of the id.
      * @param attributeId An id identifying the attribute set.
      */
-    protected void writeStartTag( String tag, String id, String name, String attributeId )
+    protected void writeStartTag( Tag tag, String id, String name, String attributeId )
     {
-        // TODO: check if id is already in attributeId, if yes, override
-        String attribs = config.getAttributeSet( attributeId );
+        MutableAttributeSet att = config.getAttributeSet( attributeId );
+
+        // make sure we don't add it twice
+        if ( att.isDefined( id ) )
+        {
+            att.removeAttribute( id );
+        }
+
+        att.addAttribute( id, name );
+
         newline();
-        write( "<fo:" + tag + " " + id + "=\"" + name + "\"" + attribs + ">" );
+        writeStartTag( tag, att );
     }
 
-
     /**
      * Writes an empty tag, prepending EOL.
      *
-     * @param tag The tag name.
+     * @param tag The tag.
      * @param id An id to add.
      * @param name The name (value) of the id.
      */
-    protected void writeEmptyTag( String tag, String id, String name )
+    protected void writeEmptyTag( Tag tag, String id, String name )
     {
-        newline();
-        write( "<fo:" + tag + " " + id + "=\"" + name + "\"/>" );
-    }
-
+        MutableAttributeSet att = new SimpleAttributeSet();
+        att.addAttribute( id, name );
 
-    /**
-     * Writes an end tag, appending EOL.
-     *
-     * @param tag The tag name.
-     */
-    protected void writeEndTag( String tag )
-    {
-        writeln( "</fo:" + tag + ">" );
+        newline();
+        writeSimpleTag( tag, att );
     }
 
     /**
@@ -1012,10 +1020,10 @@
      * @param tag The tag name.
      * @param attributeId An id identifying the attribute set.
      */
-    protected void writeEmptyTag( String tag, String attributeId )
+    protected void writeEmptyTag( Tag tag, String attributeId )
     {
-        String attribs = config.getAttributeSet( attributeId );
-        writeln( "<fo:" + tag + attribs + "/>" );
+        newline();
+        writeSimpleTag( tag, config.getAttributeSet( attributeId ) );
     }
 
     /**

Modified: maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoConfigurationTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoConfigurationTest.java?rev=577694&r1=577693&r2=577694&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoConfigurationTest.java (original)
+++ maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoConfigurationTest.java Thu Sep 20 04:40:50 2007
@@ -19,29 +19,61 @@
  * under the License.
  */
 
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.SimpleAttributeSet;
+
 import junit.framework.TestCase;
 
 /** FoConfiguration tests. */
 public class FoConfigurationTest extends TestCase
 {
 
-    /** Tests the getAttributes( String ) method. */
-    public void testGetAttributes()
+    /** Tests the getAttributeString( String ) method. */
+    public void testGetAttributeString()
     {
-        FoConfiguration attributes = new FoConfiguration();
+        FoConfiguration config = new FoConfiguration();
 
         assertEquals(
             "Null attribute ID should return empty string!",
-            "", attributes.getAttributeSet( null ) );
+            "", config.getAttributeString( null ) );
 
         assertEquals(
             "Non existent attribute ID should return empty string!",
-            "", attributes.getAttributeSet( "a.dummy.attribute" ) );
+            "", config.getAttributeString( "a.dummy.attribute" ) );
 
         assertEquals(
             "Wrong attributes returned for body.pre!",
-            " font-size=\"10pt\" font-family=\"monospace\"",
-            attributes.getAttributeSet( "body.pre" ) );
+            " font-family=\"monospace\" font-size=\"10pt\"",
+            config.getAttributeString( "body.pre" ) );
     }
+
+    /** Tests the getAttributeSet( String ) method. */
+    public void testGetAttributeSet()
+    {
+        FoConfiguration config = new FoConfiguration();
+
+        assertNull(
+            "Null attribute ID should return null AttributeSet!",
+            config.getAttributeSet( null ));
+
+        assertNull(
+            "Empty attribute ID should return null AttributeSet!",
+            config.getAttributeSet( "" ));
+
+        assertNull(
+            "Non existent attribute ID should return null AttributeSet!",
+            config.getAttributeSet( "a.dummy.attribute" ) );
+
+
+        MutableAttributeSet expected = new SimpleAttributeSet();
+        expected.addAttribute( "font-size", "10pt" );
+        expected.addAttribute( "font-family", "monospace" );
+        MutableAttributeSet actual = config.getAttributeSet( "body.pre" );
+
+        assertTrue(
+            "Wrong AttributeSet returned for body.pre!",
+            expected.isEqual( actual ) );
+    }
+
 
 }

Modified: maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java?rev=577694&r1=577693&r2=577694&view=diff
==============================================================================
--- maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java (original)
+++ maven/sandbox/trunk/doxia/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoSinkTest.java Thu Sep 20 04:40:50 2007
@@ -131,21 +131,21 @@
     /** {@inheritDoc} */
     protected String getTitleBlock( String title )
     {
-        String attribs = getConfig().getAttributeSet( "doc.header.title" );
+        String attribs = getConfig().getAttributeString( "doc.header.title" );
         return "<fo:block" + attribs + ">" + title + "</fo:block>";
     }
 
     /** {@inheritDoc} */
     protected String getAuthorBlock( String author )
     {
-        String attribs = getConfig().getAttributeSet( "doc.header.author" );
+        String attribs = getConfig().getAttributeString( "doc.header.author" );
         return "<fo:block" + attribs + ">" + author + "</fo:block>";
     }
 
     /** {@inheritDoc} */
     protected String getDateBlock( String date )
     {
-        String attribs = getConfig().getAttributeSet( "doc.header.date" );
+        String attribs = getConfig().getAttributeString( "doc.header.date" );
         return "<fo:block" + attribs + ">" + date + "</fo:block>";
     }
 
@@ -177,8 +177,8 @@
     /** {@inheritDoc} */
     protected String getSection1Block( String title )
     {
-        String attribs = getConfig().getAttributeSet( "body.text" );
-        String attrib2 = getConfig().getAttributeSet( "body.h1" );
+        String attribs = getConfig().getAttributeString( "body.text" );
+        String attrib2 = getConfig().getAttributeString( "body.h1" );
         return "<fo:block" + attribs + "><fo:block" + attrib2 + ">1   "
             + title + "</fo:block></fo:block>";
     }
@@ -186,8 +186,8 @@
     /** {@inheritDoc} */
     protected String getSection2Block( String title )
     {
-        String attribs = getConfig().getAttributeSet( "body.text" );
-        String attrib2 = getConfig().getAttributeSet( "body.h2" );
+        String attribs = getConfig().getAttributeString( "body.text" );
+        String attrib2 = getConfig().getAttributeString( "body.h2" );
         return "<fo:block" + attribs + "><fo:block" + attrib2 + ">0.1   "
             + title + "</fo:block></fo:block>";
     }
@@ -195,8 +195,8 @@
     /** {@inheritDoc} */
     protected String getSection3Block( String title )
     {
-        String attribs = getConfig().getAttributeSet( "body.text" );
-        String attrib2 = getConfig().getAttributeSet( "body.h3" );
+        String attribs = getConfig().getAttributeString( "body.text" );
+        String attrib2 = getConfig().getAttributeString( "body.h3" );
         return "<fo:block" + attribs + "><fo:block" + attrib2 + ">0.0.1   "
             + title + "</fo:block></fo:block>";
     }
@@ -204,8 +204,8 @@
     /** {@inheritDoc} */
     protected String getSection4Block( String title )
     {
-        String attribs = getConfig().getAttributeSet( "body.text" );
-        String attrib2 = getConfig().getAttributeSet( "body.h4" );
+        String attribs = getConfig().getAttributeString( "body.text" );
+        String attrib2 = getConfig().getAttributeString( "body.h4" );
         return "<fo:block" + attribs + "><fo:block" + attrib2 + ">"
             + title + "</fo:block></fo:block>";
     }
@@ -213,8 +213,8 @@
     /** {@inheritDoc} */
     protected String getSection5Block( String title )
     {
-        String attribs = getConfig().getAttributeSet( "body.text" );
-        String attrib2 = getConfig().getAttributeSet( "body.h5" );
+        String attribs = getConfig().getAttributeString( "body.text" );
+        String attrib2 = getConfig().getAttributeString( "body.h5" );
         return "<fo:block" + attribs + "><fo:block" + attrib2 + ">"
             + title + "</fo:block></fo:block>";
     }
@@ -222,8 +222,8 @@
     /** {@inheritDoc} */
     protected String getListBlock( String item )
     {
-        String attribs = getConfig().getAttributeSet( "list" );
-        String itemAttribs = getConfig().getAttributeSet( "list.item" );
+        String attribs = getConfig().getAttributeString( "list" );
+        String itemAttribs = getConfig().getAttributeString( "list.item" );
         return "<fo:list-block" + attribs + "><fo:list-item" + itemAttribs
             + "><fo:list-item-label><fo:block>&#8226;</fo:block></fo:list-item-label><fo:list-item-body"
             + itemAttribs + "><fo:block>" + item
@@ -233,8 +233,8 @@
     /** {@inheritDoc} */
     protected String getNumberedListBlock( String item )
     {
-        String attribs = getConfig().getAttributeSet( "list" );
-        String itemAttribs = getConfig().getAttributeSet( "list.item" );
+        String attribs = getConfig().getAttributeString( "list" );
+        String itemAttribs = getConfig().getAttributeString( "list.item" );
         return "<fo:list-block" + attribs + "><fo:list-item" + itemAttribs
             + "><fo:list-item-label><fo:block>i</fo:block></fo:list-item-label>"
             + "<fo:list-item-body" + itemAttribs
@@ -245,9 +245,9 @@
     /** {@inheritDoc} */
     protected String getDefinitionListBlock( String definum, String definition )
     {
-        String dlAtts = getConfig().getAttributeSet( "dl" );
-        String dtAtts = getConfig().getAttributeSet( "dt" );
-        String ddAtts = getConfig().getAttributeSet( "dd" );
+        String dlAtts = getConfig().getAttributeString( "dl" );
+        String dtAtts = getConfig().getAttributeString( "dt" );
+        String ddAtts = getConfig().getAttributeString( "dd" );
         return "<fo:block" + dlAtts + "><fo:block" + dtAtts + ">" + definum
         + "</fo:block><fo:block" + ddAtts + ">" + definition
         + "</fo:block></fo:block>";
@@ -256,9 +256,9 @@
     /** {@inheritDoc} */
     protected String getFigureBlock( String source, String caption )
     {
-        String dlAtts = getConfig().getAttributeSet( "figure.display" );
-        String dtAtts = getConfig().getAttributeSet( "figure.graphics" );
-        String ddAtts = getConfig().getAttributeSet( "figure.caption" );
+        String dlAtts = getConfig().getAttributeString( "figure.display" );
+        String dtAtts = getConfig().getAttributeString( "figure.graphics" );
+        String ddAtts = getConfig().getAttributeString( "figure.caption" );
         return "<fo:block" + dlAtts + "><fo:external-graphic" + dtAtts
             + " src=\"" + source + ".png" + "\"/><fo:block" + ddAtts
             + ">" + caption + "</fo:block></fo:block>";
@@ -267,10 +267,10 @@
     /** {@inheritDoc} */
     protected String getTableBlock( String cell, String caption )
     {
-        String dlAtts = getConfig().getAttributeSet( "table.padding" );
-        String dtAtts = getConfig().getAttributeSet( "table.layout" );
-        String ddAtts = getConfig().getAttributeSet( "table.body.row" );
-        String deAtts = getConfig().getAttributeSet( "table.body.cell" );
+        String dlAtts = getConfig().getAttributeString( "table.padding" );
+        String dtAtts = getConfig().getAttributeString( "table.layout" );
+        String ddAtts = getConfig().getAttributeString( "table.body.row" );
+        String deAtts = getConfig().getAttributeString( "table.body.cell" );
         return "<fo:block" + dlAtts + "><fo:table" + dtAtts + ">"
             + "<fo:table-column column-width=\"proportional-column-width(1)\"/>"
             + "<fo:table-column column-width=\"1in\"/>"
@@ -285,28 +285,28 @@
     /** {@inheritDoc} */
     protected String getParagraphBlock( String text )
     {
-        String attribs = getConfig().getAttributeSet( "normal.paragraph" );
+        String attribs = getConfig().getAttributeString( "normal.paragraph" );
         return "<fo:block" + attribs + ">" + text + "</fo:block>";
     }
 
     /** {@inheritDoc} */
     protected String getVerbatimBlock( String text )
     {
-        String attribs = getConfig().getAttributeSet( "body.source" );
+        String attribs = getConfig().getAttributeString( "body.source" );
         return "<fo:block" + attribs + ">" + text + "</fo:block>";
     }
 
     /** {@inheritDoc} */
     protected String getHorizontalRuleBlock()
     {
-        String attribs = getConfig().getAttributeSet( "body.rule" );
-        return "<fo:block><fo:leader" + attribs + "/></fo:block>";
+        String attribs = getConfig().getAttributeString( "body.rule" );
+        return "<fo:block><fo:leader" + attribs + " /></fo:block>";
     }
 
     /** {@inheritDoc} */
     protected String getPageBreakBlock()
     {
-        return "<fo:block break-before=\"page\"/>";
+        return "<fo:block break-before=\"page\" />";
     }
 
     /** {@inheritDoc} */
@@ -319,7 +319,7 @@
     /** {@inheritDoc} */
     protected String getLinkBlock( String link, String text )
     {
-        String attribs = getConfig().getAttributeSet( "href.internal" );
+        String attribs = getConfig().getAttributeString( "href.internal" );
         // assume that link doesn't start with #
         return "<fo:basic-link internal-destination=\"#" + link + "\"><fo:inline"
             + attribs + ">" + text + "</fo:inline></fo:basic-link>";
@@ -328,28 +328,28 @@
     /** {@inheritDoc} */
     protected String getItalicBlock( String text )
     {
-        String attribs = getConfig().getAttributeSet( "italic" );
+        String attribs = getConfig().getAttributeString( "italic" );
         return "<fo:inline" + attribs + ">" + text + "</fo:inline>";
     }
 
     /** {@inheritDoc} */
     protected String getBoldBlock( String text )
     {
-        String attribs = getConfig().getAttributeSet( "bold" );
+        String attribs = getConfig().getAttributeString( "bold" );
         return "<fo:inline" + attribs + ">" + text + "</fo:inline>";
     }
 
     /** {@inheritDoc} */
     protected String getMonospacedBlock( String text )
     {
-        String attribs = getConfig().getAttributeSet( "monospace" );
+        String attribs = getConfig().getAttributeString( "monospace" );
         return "<fo:inline" + attribs + ">" + text + "</fo:inline>";
     }
 
     /** {@inheritDoc} */
     protected String getLineBreakBlock()
     {
-        return "<fo:block/>";
+        return "<fo:block />";
     }
 
     /** {@inheritDoc} */



Mime
View raw message