maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r634662 [2/2] - in /maven/doxia/doxia/trunk: doxia-core/src/main/java/org/apache/maven/doxia/parser/ doxia-core/src/main/java/org/apache/maven/doxia/sink/ doxia-core/src/main/java/org/apache/maven/doxia/util/ doxia-core/src/test/java/org/ap...
Date Fri, 07 Mar 2008 13:27:16 GMT
Copied: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java (from r632557, maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/WellformednessCheckingSink.java)
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java?p2=maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java&p1=maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/WellformednessCheckingSink.java&r1=632557&r2=634662&rev=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/WellformednessCheckingSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java Fri Mar  7 05:27:15 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.doxia;
+package org.apache.maven.doxia.sink;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,12 +19,11 @@
  * under the License.
  */
 
-import org.apache.maven.doxia.sink.AbstractSink;
-
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Stack;
 
+
 /**
  * This sink is used for testing purposes in order to check wether
  * the input of some parser is well-formed.
@@ -57,7 +56,6 @@
     public void body_()
     {
         checkWellformedness( "body" );
-
     }
 
     public void section1()
@@ -68,7 +66,6 @@
     public void section1_()
     {
         checkWellformedness( "section1" );
-
     }
 
     public void section2()
@@ -79,7 +76,6 @@
     public void section2_()
     {
         checkWellformedness( "section2" );
-
     }
 
     public void section3()
@@ -90,7 +86,6 @@
     public void section3_()
     {
         checkWellformedness( "section3" );
-
     }
 
     public void section4()
@@ -101,7 +96,6 @@
     public void section4_()
     {
         checkWellformedness( "section4" );
-
     }
 
     public void section5()
@@ -112,7 +106,6 @@
     public void section5_()
     {
         checkWellformedness( "section5" );
-
     }
 
     public void list()
@@ -123,7 +116,6 @@
     public void list_()
     {
         checkWellformedness( "list" );
-
     }
 
     public void listItem()
@@ -134,19 +126,16 @@
     public void listItem_()
     {
         checkWellformedness( "listItem" );
-
     }
 
     public void numberedList( int numbering )
     {
         startElement( "numberedList" );
-
     }
 
     public void numberedList_()
     {
         checkWellformedness( "numberedList" );
-
     }
 
     public void numberedListItem()
@@ -157,43 +146,36 @@
     public void numberedListItem_()
     {
         checkWellformedness( "numberedListItem" );
-
     }
 
     public void definitionList()
     {
         startElement( "definitionList" );
-
     }
 
     public void definitionList_()
     {
         checkWellformedness( "definitionList" );
-
     }
 
     public void definitionListItem()
     {
         startElement( "definitionListItem" );
-
     }
 
     public void definitionListItem_()
     {
         checkWellformedness( "definitionListItem" );
-
     }
 
     public void definition()
     {
         startElement( "definition" );
-
     }
 
     public void definition_()
     {
         checkWellformedness( "definition" );
-
     }
 
     public void figure()
@@ -204,7 +186,6 @@
     public void figure_()
     {
         checkWellformedness( "figure" );
-
     }
 
     public void table()
@@ -225,7 +206,6 @@
     public void tableRows_()
     {
         checkWellformedness( "tableRows" );
-
     }
 
     public void tableRow()
@@ -561,5 +541,215 @@
     private void startElement( String string )
     {
         elements.push( string );
+    }
+
+    /** {@inheritDoc} */
+    public void head( SinkEventAttributes attributes )
+    {
+        head();
+    }
+
+    /** {@inheritDoc} */
+    public void title( SinkEventAttributes attributes )
+    {
+        title();
+    }
+
+    /** {@inheritDoc} */
+    public void author( SinkEventAttributes attributes )
+    {
+        author();
+    }
+
+    /** {@inheritDoc} */
+    public void date( SinkEventAttributes attributes )
+    {
+        date();
+    }
+
+    /** {@inheritDoc} */
+    public void body( SinkEventAttributes attributes )
+    {
+        body();
+    }
+
+    /** {@inheritDoc} */
+    public void section( int level, SinkEventAttributes attributes )
+    {
+        startElement( "section" + level );
+    }
+
+    /** {@inheritDoc} */
+    public void section_( int level )
+    {
+        checkWellformedness( "section" + level );
+    }
+
+    /** {@inheritDoc} */
+    public void sectionTitle( int level, SinkEventAttributes attributes )
+    {
+        startElement( "sectionTitle" + level );
+    }
+
+    /** {@inheritDoc} */
+    public void sectionTitle_( int level )
+    {
+        checkWellformedness( "sectionTitle" + level );
+    }
+
+    /** {@inheritDoc} */
+    public void list( SinkEventAttributes attributes )
+    {
+        list();
+    }
+
+    /** {@inheritDoc} */
+    public void listItem( SinkEventAttributes attributes )
+    {
+        listItem();
+    }
+
+    /** {@inheritDoc} */
+    public void numberedList( int numbering, SinkEventAttributes attributes )
+    {
+        numberedList( numbering );
+    }
+
+    /** {@inheritDoc} */
+    public void numberedListItem( SinkEventAttributes attributes )
+    {
+        numberedListItem();
+    }
+
+    /** {@inheritDoc} */
+    public void definitionList( SinkEventAttributes attributes )
+    {
+        definitionList();
+    }
+
+    /** {@inheritDoc} */
+    public void definitionListItem( SinkEventAttributes attributes )
+    {
+        definitionListItem();
+    }
+
+    /** {@inheritDoc} */
+    public void definition( SinkEventAttributes attributes )
+    {
+        definition();
+    }
+
+    /** {@inheritDoc} */
+    public void definedTerm( SinkEventAttributes attributes )
+    {
+        definedTerm();
+    }
+
+    /** {@inheritDoc} */
+    public void figure( SinkEventAttributes attributes )
+    {
+        figure();
+    }
+
+    /** {@inheritDoc} */
+    public void figureCaption( SinkEventAttributes attributes )
+    {
+        figureCaption();
+    }
+
+    /** {@inheritDoc} */
+    public void figureGraphics( String src, SinkEventAttributes attributes )
+    {
+        figureGraphics( src );
+    }
+
+    /** {@inheritDoc} */
+    public void table( SinkEventAttributes attributes )
+    {
+        table();
+    }
+
+    /** {@inheritDoc} */
+    public void tableRow( SinkEventAttributes attributes )
+    {
+        tableRow();
+    }
+
+    /** {@inheritDoc} */
+    public void tableCell( SinkEventAttributes attributes )
+    {
+        tableCell();
+    }
+
+    /** {@inheritDoc} */
+    public void tableHeaderCell( SinkEventAttributes attributes )
+    {
+        tableHeaderCell();
+    }
+
+    /** {@inheritDoc} */
+    public void tableCaption( SinkEventAttributes attributes )
+    {
+        tableCaption();
+    }
+
+    /** {@inheritDoc} */
+    public void paragraph( SinkEventAttributes attributes )
+    {
+        paragraph();
+    }
+
+    /** {@inheritDoc} */
+    public void verbatim( SinkEventAttributes attributes )
+    {
+        verbatim( false );
+    }
+
+    /** {@inheritDoc} */
+    public void horizontalRule( SinkEventAttributes attributes )
+    {
+        horizontalRule();
+    }
+
+    /** {@inheritDoc} */
+    public void anchor( String name, SinkEventAttributes attributes )
+    {
+        anchor( name );
+    }
+
+    /** {@inheritDoc} */
+    public void link( String name, SinkEventAttributes attributes )
+    {
+        link( name );
+    }
+
+    /** {@inheritDoc} */
+    public void italic( SinkEventAttributes attributes )
+    {
+        italic();
+    }
+
+    /** {@inheritDoc} */
+    public void bold( SinkEventAttributes attributes )
+    {
+        bold();
+    }
+
+    /** {@inheritDoc} */
+    public void monospaced( SinkEventAttributes attributes )
+    {
+        monospaced();
+    }
+
+    /** {@inheritDoc} */
+    public void lineBreak( SinkEventAttributes attributes )
+    {
+        lineBreak();
+    }
+
+    /** {@inheritDoc} */
+    public void text( String text, SinkEventAttributes attributes )
+    {
+        text( text );
     }
 }

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/StructureSinkUtilsTest.java Fri Mar  7 05:27:15 2008
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-import org.apache.maven.doxia.util.StructureSinkUtils;
 import org.codehaus.plexus.PlexusTestCase;
 
 /**

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java Fri Mar  7 05:27:15 2008
@@ -27,7 +27,7 @@
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.XMLConfiguration;
 
-import org.apache.maven.doxia.sink.AbstractXmlSink;
+import org.apache.maven.doxia.sink.SinkUtils;
 
 /**
  * A utility class to construct FO configuration parameters.
@@ -94,7 +94,7 @@
         reset();
         addAttributes( attributeId );
 
-        return AbstractXmlSink.getAttributeString( attributeSet );
+        return SinkUtils.getAttributeString( attributeSet );
     }
 
     /**

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java Fri Mar  7 05:27:15 2008
@@ -36,6 +36,7 @@
 import org.apache.maven.doxia.parser.XhtmlBaseParser;
 import org.apache.maven.doxia.sink.Sink;
 
+import org.apache.maven.doxia.sink.SinkEventAttributeSet;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParser;
@@ -99,6 +100,8 @@
     {
         isEmptyElement = parser.isEmptyElementTag();
 
+        SinkEventAttributeSet attribs = getAttributesFromParser( parser );
+
         if ( parser.getName().equals( DOCUMENT_TAG.toString() ) )
         {
             //Do nothing
@@ -106,31 +109,31 @@
         }
         else if ( parser.getName().equals( Tag.HEAD.toString() ) )
         {
-            sink.head();
+            sink.head( attribs );
         }
         else if ( parser.getName().equals( Tag.TITLE.toString() ) )
         {
-            sink.title();
+            sink.title( attribs );
         }
         else if ( parser.getName().equals( AUTHOR_TAG.toString() ) )
         {
-            sink.author();
+            sink.author( attribs );
         }
         else if ( parser.getName().equals( DATE_TAG.toString() ) )
         {
-            sink.date();
+            sink.date( attribs );
         }
         else if ( parser.getName().equals( Tag.BODY.toString() ) )
         {
-            sink.body();
+            sink.body( attribs );
         }
         else if ( parser.getName().equals( SECTION_TAG.toString() ) )
         {
             closeOpenSections( Sink.SECTION_LEVEL_1, sink );
 
-            sink.section1();
+            sink.section( Sink.SECTION_LEVEL_1, attribs );
 
-            sink.sectionTitle1();
+            sink.sectionTitle( Sink.SECTION_LEVEL_1, attribs );
 
             sink.text( parser.getAttributeValue( null, Attribute.NAME.toString() ) );
 
@@ -140,9 +143,9 @@
         {
             closeOpenSections( Sink.SECTION_LEVEL_2, sink );
 
-            sink.section2();
+            sink.section( Sink.SECTION_LEVEL_2, attribs );
 
-            sink.sectionTitle2();
+            sink.sectionTitle( Sink.SECTION_LEVEL_2, attribs );
 
             sink.text( parser.getAttributeValue( null, Attribute.NAME.toString() ) );
 
@@ -152,7 +155,9 @@
         {
             verbatim();
 
-            sink.verbatim( true );
+            attribs.addAttribute( "boxed", "true");
+
+            sink.verbatim( attribs );
         }
         else if ( parser.getName().equals( PROPERTIES_TAG.toString() ) )
         {
@@ -382,15 +387,15 @@
     {
         while ( getSectionLevel() >= newLevel )
         {
-            if ( getSectionLevel() == Sink.SECTION_LEVEL_5)
+            if ( getSectionLevel() == Sink.SECTION_LEVEL_5 )
             {
                 sink.section5_();
             }
-            else if ( getSectionLevel() == Sink.SECTION_LEVEL_4)
+            else if ( getSectionLevel() == Sink.SECTION_LEVEL_4 )
             {
                 sink.section4_();
             }
-            else if ( getSectionLevel() == Sink.SECTION_LEVEL_3)
+            else if ( getSectionLevel() == Sink.SECTION_LEVEL_3 )
             {
                 sink.section3_();
             }

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java Fri Mar  7 05:27:15 2008
@@ -22,10 +22,12 @@
 import java.io.Writer;
 
 import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.SimpleAttributeSet;
 import javax.swing.text.html.HTML.Attribute;
 import javax.swing.text.html.HTML.Tag;
 
+import org.apache.maven.doxia.sink.SinkEventAttributeSet;
+import org.apache.maven.doxia.sink.SinkEventAttributes;
+import org.apache.maven.doxia.sink.SinkUtils;
 import org.apache.maven.doxia.sink.XhtmlBaseSink;
 import org.apache.maven.doxia.util.HtmlTools;
 import org.apache.maven.doxia.util.StructureSinkUtils;
@@ -194,17 +196,21 @@
      * @see XdocMarkup#SECTION_TAG
      * @see XdocMarkup#SUBSECTION_TAG
      */
-    protected void onSection( int depth )
+    protected void onSection( int depth, SinkEventAttributes attributes )
     {
         if ( depth == SECTION_LEVEL_1 )
         {
             write( String.valueOf( LESS_THAN ) + SECTION_TAG.toString() + String.valueOf( SPACE ) + Attribute.NAME
-                + String.valueOf( EQUAL ) + String.valueOf( QUOTE ) );
+                + String.valueOf( EQUAL ) + String.valueOf( QUOTE )
+                + SinkUtils.getAttributeString( SinkUtils.filterAttributes(
+                    attributes, SinkUtils.SINK_BASE_ATTRIBUTES  ) ) );
         }
         else if ( depth == SECTION_LEVEL_2 )
         {
             write( String.valueOf( LESS_THAN ) + SUBSECTION_TAG.toString() + String.valueOf( SPACE ) + Attribute.NAME
-                + String.valueOf( EQUAL ) + String.valueOf( QUOTE ) );
+                + String.valueOf( EQUAL ) + String.valueOf( QUOTE )
+                + SinkUtils.getAttributeString( SinkUtils.filterAttributes(
+                    attributes, SinkUtils.SINK_BASE_ATTRIBUTES  ) ) );
         }
     }
 
@@ -235,19 +241,22 @@
      * @see javax.swing.text.html.HTML.Tag#H5
      * @see javax.swing.text.html.HTML.Tag#H6
      */
-    protected void onSectionTitle( int depth )
+    protected void onSectionTitle( int depth, SinkEventAttributes attributes )
     {
+        MutableAttributeSet atts = SinkUtils.filterAttributes(
+                attributes, SinkUtils.SINK_SECTION_ATTRIBUTES  );
+
         if ( depth == SECTION_LEVEL_3 )
         {
-            writeStartTag( Tag.H4 );
+            writeStartTag( Tag.H4, atts );
         }
         else if ( depth == SECTION_LEVEL_4 )
         {
-            writeStartTag( Tag.H5 );
+            writeStartTag( Tag.H5, atts );
         }
         else if ( depth == SECTION_LEVEL_5 )
         {
-            writeStartTag( Tag.H6 );
+            writeStartTag( Tag.H6, atts );
         }
     }
 
@@ -288,19 +297,38 @@
      * @see XdocMarkup#SOURCE_TAG
      * @see javax.swing.text.html.HTML.Tag#PRE
      */
-    public void verbatim( boolean boxed )
+    public void verbatim( SinkEventAttributes attributes )
     {
         setVerbatimFlag( true );
 
+        MutableAttributeSet atts = SinkUtils.filterAttributes(
+                attributes, SinkUtils.SINK_VERBATIM_ATTRIBUTES  );
+
+
+        if ( atts == null )
+        {
+            atts = new SinkEventAttributeSet();
+        }
+
+        boolean boxed = false;
+
+        if ( atts.isDefined( "boxed" ) )
+        {
+            boxed = Boolean.valueOf(
+                (String) atts.getAttribute( "boxed" ) ).booleanValue();
+        }
+
         boxedFlag = boxed;
+        atts.removeAttribute( "boxed" );
 
         if ( boxed )
         {
-            writeStartTag( SOURCE_TAG );
+            writeStartTag( SOURCE_TAG, atts );
         }
         else
         {
-            writeStartTag( Tag.PRE );
+            atts.removeAttribute( Attribute.ALIGN.toString() );
+            writeStartTag( Tag.PRE, atts );
         }
     }
 
@@ -335,7 +363,7 @@
     {
         setCellJustif( justification );
 
-        MutableAttributeSet att = new SimpleAttributeSet();
+        MutableAttributeSet att = new SinkEventAttributeSet();
         att.addAttribute( Attribute.ALIGN, "center" );
         att.addAttribute( Attribute.BORDER, ( grid ? "1" : "0" ) );
 
@@ -350,7 +378,7 @@
      */
     public void tableRow()
     {
-        MutableAttributeSet att = new SimpleAttributeSet();
+        MutableAttributeSet att = new SinkEventAttributeSet();
         att.addAttribute( Attribute.VALIGN, "top" );
 
         writeStartTag( Tag.TR, att );
@@ -371,7 +399,7 @@
             return;
         }
 
-        MutableAttributeSet att = new SimpleAttributeSet();
+        MutableAttributeSet att = new SinkEventAttributeSet();
 
         if ( target != null )
         {
@@ -388,19 +416,6 @@
         }
 
         writeStartTag( Tag.A, att );
-    }
-
-    /**
-     * Legacy: treat links to other html documents as external links.
-     * Note that links to other file formats (images, pdf) will still be broken,
-     * links to other documents should always start with "./" or "../".
-     */
-    private boolean isExternalHtml( String href )
-    {
-        String text = href.toLowerCase();
-        return ( text.indexOf( ".html#" ) != -1 || text.indexOf( ".htm#" ) != -1
-            || text.endsWith( ".htm" ) || text.endsWith( ".html" )
-            || !HtmlTools.isId( text ) );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java Fri Mar  7 05:27:15 2008
@@ -235,7 +235,6 @@
      */
     private String noNewLine( String text )
     {
-        String EOL = System.getProperty( "line.separator" );
         return text.replaceAll( EOL, "" );
     }
 }

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java Fri Mar  7 05:27:15 2008
@@ -138,16 +138,8 @@
     /** {@inheritDoc} */
     protected String getTableBlock( String cell, String caption )
     {
-        return "<table align=\"center\"><table align=\"center\" border=\"0\"><tr valign=\"top\"><td>"
-            + cell + "</td></tr></table><p><i>" + caption + "</i></p></table>";
-    }
-
-    // Disable testTable until the order of attributes issue is clarified
-    // TODO: remove
-    /** {@inheritDoc} */
-    public void testTable()
-    {
-        assertEquals( "Dummy!", "", "" );
+        return "<table align=\"center\" border=\"0\"><tr valign=\"top\"><td align=\"center\">"
+            + cell + "</td></tr><caption>" + caption + "</caption></table>";
     }
 
     /** {@inheritDoc} */

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java Fri Mar  7 05:27:15 2008
@@ -26,6 +26,7 @@
 import org.apache.maven.doxia.parser.XhtmlBaseParser;
 import org.apache.maven.doxia.sink.Sink;
 
+import org.apache.maven.doxia.sink.SinkEventAttributeSet;
 import org.codehaus.plexus.util.xml.pull.XmlPullParser;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
@@ -48,6 +49,8 @@
     protected void handleStartTag( XmlPullParser parser, Sink sink )
         throws XmlPullParserException, MacroExecutionException
     {
+        SinkEventAttributeSet attribs = getAttributesFromParser( parser );
+
         if ( parser.getName().equals( Tag.HTML.toString() ) )
         {
             //Do nothing
@@ -55,11 +58,11 @@
         }
         else if ( parser.getName().equals( Tag.HEAD.toString() ) )
         {
-            sink.head();
+            sink.head( attribs );
         }
         else if ( parser.getName().equals( Tag.TITLE.toString() ) )
         {
-            sink.title();
+            sink.title( attribs );
         }
         else if ( parser.getName().equals( Tag.META.toString() ) )
         {
@@ -67,9 +70,12 @@
 
             String content = parser.getAttributeValue( null, Attribute.CONTENT.toString() );
 
+            attribs.removeAttribute( Attribute.NAME.toString() );
+            attribs.removeAttribute( Attribute.CONTENT.toString() );
+
             if ( "author".equals( name ) )
             {
-                sink.author();
+                sink.author( attribs );
 
                 sink.text( content );
 
@@ -77,7 +83,7 @@
             }
             else if ( "date".equals( name ) )
             {
-                sink.date();
+                sink.date( attribs );
 
                 sink.text( content );
 
@@ -91,11 +97,11 @@
          */
         else if ( parser.getName().equals( Tag.ADDRESS.toString() ) )
         {
-            sink.author();
+            sink.author( attribs );
         }
         else if ( parser.getName().equals( Tag.BODY.toString() ) )
         {
-            sink.body();
+            sink.body( attribs );
         }
         else if ( parser.getName().equals( Tag.DIV.toString() ) )
         {
@@ -118,14 +124,9 @@
          */
         else if ( parser.getName().equals( Tag.PRE.toString() ) )
         {
-            if ( this.boxed )
-            {
-                sink.verbatim( true );
-            }
-            else
-            {
-                sink.verbatim( false );
-            }
+            attribs.addAttribute( "boxed", Boolean.toString( boxed ) );
+
+            sink.verbatim( attribs );
         }
         else if ( !baseStartTag( parser, sink ) )
         {

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlSink.java Fri Mar  7 05:27:15 2008
@@ -23,12 +23,12 @@
 import java.util.Map;
 
 import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.SimpleAttributeSet;
 import javax.swing.text.html.HTML.Attribute;
 import javax.swing.text.html.HTML.Tag;
 
 import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
 import org.apache.maven.doxia.sink.XhtmlBaseSink;
+import org.apache.maven.doxia.sink.SinkEventAttributeSet;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
@@ -137,7 +137,7 @@
     {
         if ( getBuffer().length() > 0 )
         {
-            MutableAttributeSet att = new SimpleAttributeSet();
+            MutableAttributeSet att = new SinkEventAttributeSet();
             att.addAttribute( Attribute.NAME, "author" );
             att.addAttribute( Attribute.CONTENT, getBuffer().toString() );
 
@@ -155,7 +155,7 @@
     {
         if ( getBuffer().length() > 0 )
         {
-            MutableAttributeSet att = new SimpleAttributeSet();
+            MutableAttributeSet att = new SinkEventAttributeSet();
             att.addAttribute( Attribute.NAME, "date" );
             att.addAttribute( Attribute.CONTENT, getBuffer().toString() );
 

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java Fri Mar  7 05:27:15 2008
@@ -21,7 +21,6 @@
 
 import java.util.Iterator;
 
-import org.apache.maven.doxia.WellformednessCheckingSink;
 import org.apache.maven.doxia.parser.AbstractParserTest;
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.sink.SinkEventElement;

Modified: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java?rev=634662&r1=634661&r2=634662&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java (original)
+++ maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java Fri Mar  7 05:27:15 2008
@@ -53,6 +53,7 @@
  * @since 1.0
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @author ltheussl
  * @version $Id$
  */
 public interface Sink
@@ -130,6 +131,14 @@
     void head();
 
     /**
+     * Starts the head element.
+     * Supported attributes are: "profile", DIR, LANG.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void head( SinkEventAttributes attributes );
+
+    /**
      * Ending the head element.
      */
     void head_();
@@ -140,6 +149,14 @@
     void title();
 
     /**
+     * Starts the title.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void title( SinkEventAttributes attributes );
+
+    /**
      * Ending the title element.
      */
     void title_();
@@ -150,6 +167,14 @@
     void author();
 
     /**
+     * Starts an author element.
+     * Supported attributes are: "email".
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void author( SinkEventAttributes attributes );
+
+    /**
      * Ending the author element.
      */
     void author_();
@@ -160,6 +185,14 @@
     void date();
 
     /**
+     * Starts a date element.
+     * Supported attributes are: none.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void date( SinkEventAttributes attributes );
+
+    /**
      * Ending the date element.
      */
     void date_();
@@ -170,6 +203,13 @@
     void body();
 
     /**
+     * Starts the body of a document which contains the document's content.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void body( SinkEventAttributes attributes );
+    /**
      * Ending the body element.
      */
     void body_();
@@ -285,11 +325,50 @@
     void sectionTitle5_();
 
     /**
+     * Start a new section at the given level.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param level the section level.
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void section( int level, SinkEventAttributes attributes );
+
+    /**
+     * Ends a section at the given level.
+     *
+     * @param level the section level.
+     */
+    void section_( int level );
+
+    /**
+     * Start a new section title at the given level.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} and ALIGN.
+     *
+     * @param level the section title level.
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void sectionTitle( int level, SinkEventAttributes attributes );
+
+    /**
+     * Ends a section title at the given level.
+     *
+     * @param level the section title level.
+     */
+    void sectionTitle_( int level );
+
+    /**
      * Starting an unordered list element.
      */
     void list();
 
     /**
+     * Starts an unordered list.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void list( SinkEventAttributes attributes );
+    /**
      * Ending an unordered list element.
      */
     void list_();
@@ -300,6 +379,14 @@
     void listItem();
 
     /**
+     * Starts a list item element within an unordered list.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void listItem( SinkEventAttributes attributes );
+
+    /**
      * Ending a list item element within an unordered list.
      */
     void listItem_();
@@ -307,7 +394,7 @@
     /**
      * Starting an ordered list element.
      *
-     * @param numbering the numbering wanted
+     * @param numbering the numbering style.
      * @see #NUMBERING_DECIMAL
      * @see #NUMBERING_LOWER_ALPHA
      * @see #NUMBERING_LOWER_ROMAN
@@ -317,6 +404,14 @@
     void numberedList( int numbering );
 
     /**
+     * Starts an ordered list element.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param numbering the numbering style.
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void numberedList( int numbering, SinkEventAttributes attributes );
+    /**
      * Ending an ordered list element.
      */
     void numberedList_();
@@ -327,6 +422,14 @@
     void numberedListItem();
 
     /**
+     * Starts a list item element within an ordered list.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void numberedListItem( SinkEventAttributes attributes );
+
+    /**
      * Ending a list item element within an ordered list.
      */
     void numberedListItem_();
@@ -337,6 +440,14 @@
     void definitionList();
 
     /**
+     * Starts a definition list.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void definitionList( SinkEventAttributes attributes );
+
+    /**
      * Ending a definition list element.
      */
     void definitionList_();
@@ -347,6 +458,14 @@
     void definitionListItem();
 
     /**
+     * Starting a list item element within a definition list.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void definitionListItem( SinkEventAttributes attributes );
+
+    /**
      * Ending a list item element within a definition list.
      */
     void definitionListItem_();
@@ -357,6 +476,14 @@
     void definition();
 
     /**
+     * Starts a definition element within a definition list.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void definition( SinkEventAttributes attributes );
+
+    /**
      * Ending a definition element within a definition list.
      */
     void definition_();
@@ -367,6 +494,14 @@
     void definedTerm();
 
     /**
+     * Starts a definition term element within a definition list.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void definedTerm( SinkEventAttributes attributes );
+
+    /**
      * Starting a definition term element within a definition list.
      */
     void definedTerm_();
@@ -377,6 +512,14 @@
     void figure();
 
     /**
+     * Starting a basic image embedding element.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void figure( SinkEventAttributes attributes );
+
+    /**
      * Ending a basic image embedding element.
      */
     void figure_();
@@ -387,6 +530,13 @@
     void figureCaption();
 
     /**
+     * Starts a figure caption.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void figureCaption( SinkEventAttributes attributes );
+    /**
      * Ending a caption of an image.
      */
     void figureCaption_();
@@ -399,11 +549,34 @@
     void figureGraphics( String name );
 
     /**
+     * Adds a graphic element.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus:
+     * <blockquote>
+     * SRC, ALT, WIDTH, HEIGHT, ALIGN, BORDER, HSPACE, VSPACE, ISMAP, USEMAP.
+     * </blockquote>
+     * If the SRC attribute is specified, it will be overidden by the src parameter.
+     *
+     * @param src the image source.
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void figureGraphics( String src, SinkEventAttributes attributes );
+
+    /**
      * Starting a table element for marking up tabular information in a document.
      */
     void table();
 
     /**
+     * Starts a table.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus:
+     * <blockquote>ALIGN, BGCOLOR, BORDER, CELLPADDING, CELLSPACING,
+     * "frame", "rules", "summary", WIDTH.</blockquote>
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void table( SinkEventAttributes attributes );
+
+    /**
      * Ending a table element.
      */
     void table_();
@@ -411,8 +584,12 @@
     /**
      * Starting an element contains rows of table data.
      *
-     * @param justification the justification wanted
-     * @param grid true to provide a grid, false otherwise
+     * @param justification the default justification of columns.
+     * This can be overridden by individual table rows or table cells.
+     * If null a left alignment is assumed by default. If this array
+     * has less elements than there are columns in the table then the value of
+     * the last array element will be taken as default for the remaining table cells.
+     * @param grid true to provide a grid, false otherwise.
      */
     void tableRows( int[] justification, boolean grid );
 
@@ -427,6 +604,15 @@
     void tableRow();
 
     /**
+     * Starts a table row.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus:
+     * <blockquote>ALIGN, BGCOLOR, VALIGN.</blockquote>
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void tableRow( SinkEventAttributes attributes );
+
+    /**
      * Ending a row element.
      */
     void tableRow_();
@@ -444,6 +630,16 @@
     void tableCell( String width );
 
     /**
+     * Starts a table cell.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus:
+     * <blockquote>"abbrv", ALIGN, "axis", BGCOLOR, COLSPAN, "headers",
+     * HEIGHT, NOWRAP, ROWSPAN, "scope", VALIGN, WIDTH.</blockquote>
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void tableCell( SinkEventAttributes attributes );
+
+    /**
      * Ending a cell element.
      */
     void tableCell_();
@@ -461,6 +657,16 @@
     void tableHeaderCell( String width );
 
     /**
+     * Starts a table header cell.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus:
+     * <blockquote>"abbrv", ALIGN, "axis", BGCOLOR, COLSPAN, "headers",
+     * HEIGHT, NOWRAP, ROWSPAN, "scope", VALIGN, WIDTH.</blockquote>
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void tableHeaderCell( SinkEventAttributes attributes );
+
+    /**
      * Ending a cell header element.
      */
     void tableHeaderCell_();
@@ -471,6 +677,14 @@
     void tableCaption();
 
     /**
+     * Starts a table caption.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus ALIGN.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void tableCaption( SinkEventAttributes attributes );
+
+    /**
      * Ending a caption element of a table.
      */
     void tableCaption_();
@@ -481,6 +695,14 @@
     void paragraph();
 
     /**
+     * Starts a paragraph.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus ALIGN.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void paragraph( SinkEventAttributes attributes );
+
+    /**
      * Ending a paragraph element.
      */
     void paragraph_();
@@ -493,6 +715,14 @@
     void verbatim( boolean boxed );
 
     /**
+     * Starts a verbatim block, ie a block where whitespace has semantic relevance.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus: "boxed", ALIGN, WIDTH.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void verbatim( SinkEventAttributes attributes );
+
+    /**
      * Ending a verbatim element.
      */
     void verbatim_();
@@ -503,6 +733,15 @@
     void horizontalRule();
 
     /**
+     * Adds a horizontal separator rule.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus:
+     * ALIGN, NOSHADE, SIZE, WIDTH.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void horizontalRule( SinkEventAttributes attributes );
+
+    /**
      * Adding a new page separator.
      */
     void pageBreak();
@@ -510,11 +749,21 @@
     /**
      * Starting an element which defines an anchor.
      *
-     * @param name the name of the anchor
+     * @param name the name of the anchor.
      */
     void anchor( String name );
 
     /**
+     * Starts an element which defines an anchor.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     * If NAME is specified in the SinkEventAttributes,
+     * it will be overwritten by the name parameter.
+     *
+     * @param name the name of the anchor.
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void anchor( String name, SinkEventAttributes attributes );
+    /**
      * Ending an anchor element.
      */
     void anchor_();
@@ -522,11 +771,22 @@
     /**
      * Starting an element which defines a link.
      *
-     * @param name the name of the link
+     * @param name the name of the link.
      */
     void link( String name );
 
     /**
+     * Starts a link.
+     * Supported attributes are the {@link SinkEventAttributes base attributes} plus:
+     * <blockquote>"charset", COORDS, HREF, "hreflang", REL, REV, SHAPE,
+     * TARGET, TYPE.</blockquote> If HREF is specified in the
+     * SinkEventAttributes, it will be overwritten by the name parameter.
+     *
+     * @param name the name of the link.
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void link( String name, SinkEventAttributes attributes );
+    /**
      * Ending a link element.
      */
     void link_();
@@ -537,6 +797,14 @@
     void italic();
 
     /**
+     * Starts an italic element.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void italic( SinkEventAttributes attributes );
+
+    /**
      * Ending an italic element.
      */
     void italic_();
@@ -547,6 +815,14 @@
     void bold();
 
     /**
+     * Starts a bold element.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void bold( SinkEventAttributes attributes );
+
+    /**
      * Ending a bold element.
      */
     void bold_();
@@ -557,16 +833,32 @@
     void monospaced();
 
     /**
+     * Starts a monospaced element.
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void monospaced( SinkEventAttributes attributes );
+
+    /**
      * Ending a monospaced element.
      */
     void monospaced_();
 
     /**
-     * Adding a line breaks.
+     * Adds a line break.
      */
     void lineBreak();
 
     /**
+     * Adds a line break.
+     * Supported attributes are ID, CLASS, TITLE and STYLE.
+     *
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void lineBreak( SinkEventAttributes attributes );
+
+    /**
      * Adding a non breaking space, <i>ie</i> a space without any special formatting operations.
      */
     void nonBreakingSpace();
@@ -577,6 +869,15 @@
      * @param text The text to write.
      */
     void text( String text );
+    
+    /**
+     * Adds a text. 
+     * Supported attributes are the {@link SinkEventAttributes base attributes}.
+     *
+     * @param text The text to write.
+     * @param attributes A set of {@link SinkEventAttributes}.
+     */
+    void text( String text, SinkEventAttributes attributes );
 
     /**
      * Adding a raw text, <i>ie</i> a text without any special formatting operations.

Added: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java?rev=634662&view=auto
==============================================================================
--- maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java (added)
+++ maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java Fri Mar  7 05:27:15 2008
@@ -0,0 +1,292 @@
+package org.apache.maven.doxia.sink;
+
+/*
+ * 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.MutableAttributeSet;
+
+/**
+ * A set of attributes for a sink event.
+ * <p>
+ * All sink methods that produce some presentation-level output should have at least
+ * one form that allows to pass in a Set of SinkEventAttributes. For instance in
+ * <pre>void text( String text, SinkEventAttributes attributes );</pre>
+ * the <code>attributes</code> parameter can be used to specify some text styling
+ * options, or other optional parameters.
+ * </p>
+ * <p>
+ * What kind of attributes are supported depends on the event and the sink
+ * implementation. The sink API just specifies a list of suggested attribute
+ * names, that sinks are expected to recognize, and parsers are expected to use
+ * preferably when emitting events.
+ * </p>
+ * <p>
+ * It is recommended that for simple attributes, both keys and values should be
+ * lower-case Strings, but this is not mandatory. One example of an exception is
+ * the {@link #STYLE} attribute, whose value may itself be an AttributeSet again.
+ * </p>
+ * <p>
+ * The <b>base attributes</b> that are supported by almost all events are
+ * {@link #CLASS}, {@link #ID}, {@link #LANG}, {@link #STYLE} and {@link #TITLE}.
+ * </p>
+ *
+ * @author ltheussl
+ * @version $Id$
+ * @since 1.0-beta-1
+ */
+public interface SinkEventAttributes
+    extends MutableAttributeSet
+{
+    // base
+
+    /**
+     * The class of the event element.
+     */
+    String CLASS = "class";
+
+    /**
+     * A unique id for the event element.
+     */
+    String ID = "id";
+
+    /**
+     * The language code for the event element.
+     */
+    String LANG = "lang";
+
+    /**
+     * An inline style definition.
+     * @todo specify recommended format with AttributSet values
+     */
+    String STYLE = "style";
+
+    /**
+     * A text to display in a tool tip.
+     */
+    String TITLE = "title";
+
+    // img
+
+    /**
+     * Specifies the alignment of the event element within its parent element.
+     * Generally supported values are "left", "right", "center", "justify".
+     */
+    String ALIGN = "align";
+
+    /**
+     * Defines a short description of the event element.
+     */
+    String ALT = "alt";
+
+    /**
+     * Defines a border around an event element.
+     */
+    String BORDER = "border";
+
+    /**
+     * Defines the height of an event element.
+     */
+    String HEIGHT = "height";
+
+    /**
+     * Defines white space on the left and right side of an event element.
+     */
+    String HSPACE = "hspace";
+
+    /**
+     * Defines an image as a server-side image map.
+     * Only used by the figureGraphics Sink event.
+     */
+    String ISMAP = "ismap";
+
+    /**
+     * The URL of an external resource, eg an image.
+     */
+    String SRC = "src";
+
+    /**
+     * Defines an image as a client-side image map.
+     */
+    String USEMAP = "usemap";
+
+    /**
+     * Defines white space on the top and bottom of the event element.
+     */
+    String VSPACE = "vspace";
+
+    /**
+     * Sets the width of  an event element.
+     */
+    String WIDTH = "width";
+
+    // hr
+
+    /**
+     * Used to indicate that an element comes with a shadow.
+     */
+    String NOSHADE = "noshade";
+
+    /**
+     * May specifies the size, or thickness, or height of an event element.
+     */
+    String SIZE = "size";
+
+    // link
+
+    /**
+     * Specifies the character encoding of text associated with an event element.
+     */
+    String CHARSET = "charset";
+
+    /**
+     * May be used in conjunction with {@link #SHAPE}.
+     * Valid values are the same as for the corresponding HTML attributes.
+     */
+    String COORDS = "coords";
+
+    /**
+     * The target URL of an event element, eg a link.
+     */
+    String HREF = "href";
+
+    /**
+     * Specifies the base language of the target URL.
+     * Used in conjunction with {@link #HREF}.
+     */
+    String HREFLANG = "hreflang";
+
+    /**
+     * For references to external resourcs, specifies the relationship between
+     * the current document and the target URL.
+     * Valid values are the same as for the corresponding HTML attribute.
+     */
+    String REL = "rel";
+
+    /**
+     * For references to external resourcs, specifies the relationship between
+     * the target URL and the current document.
+     * Valid values are the same as for the corresponding HTML attribute.
+     */
+    String REV = "rev";
+
+    /**
+     * Defines the type of region to be defined for a mapping.
+     * Used with the {@link #COORDS} attribute.
+     */
+    String SHAPE = "shape";
+
+    /**
+     * Where to open the target URL.
+     * Valid values are the same as for the corresponding HTML attribute.
+     */
+    String TARGET = "target";
+
+    /**
+     * Specifies the MIME (Multipurpose Internet Mail Extensions) type of an
+     * external resource URL, eg a link.
+     */
+    String TYPE = "type";
+
+    // table
+
+    /**
+     * Specifies the background color of an event element.
+     */
+    String BGCOLOR = "bgcolor";
+
+    /**
+     * Specifies the space between cell walls and contents.
+     */
+    String CELLPADDING = "cellpadding";
+
+    /**
+     * Specifies the space between cells.
+     */
+    String CELLSPACING = "cellspacing";
+
+    /**
+     * Specifies which sides of a border surrounding an element should be visible.
+     * Valid values are the same as for the corresponding HTML attribute.
+     */
+    String FRAME = "frame";
+
+    /**
+     * Specifies horizontal/vertical divider lines between certain elements, eg table cells.
+     */
+    String RULES = "rules";
+
+    /**
+     * Specifies a summary of an event attribute for
+     * speech-synthesizing/non-visual target output.
+     */
+    String SUMMARY = "summary";
+
+    // table cell
+
+    /**
+     * Specifies an abbreviated version of the content in an element.
+     */
+    String ABBRV = "abbrv";
+
+    /**
+     * Defines a name for a cell.
+     */
+    String AXIS = "axis";
+
+    /**
+     * Indicates the number of columns a cell should span. Used in tables.
+     */
+    String COLSPAN = "colspan";
+
+    /**
+     * A space-separated list of cell IDs that supply header information for the cell.
+     */
+    String HEADERS = "headers";
+
+    /**
+     * Whether to disable or enable automatic text wrapping for an element. 
+     */
+    String NOWRAP = "nowrap";
+
+    /**
+     * Indicates the number of rows a cell should span. Used in tables.
+     */
+    String ROWSPAN = "rowspan";
+
+    /**
+     * A general scope parameter. In Particular, for table cells this
+     * specifies if the cell provides header information for the rest of the
+     * row that contains it ("row"), or for the rest of the column ("col"),
+     * or for the rest of the row group that contains it ("rowgroup"),
+     * or for the rest of the column group that contains it ("colgroup").
+     */
+    String SCOPE = "scope";
+
+    /**
+     * Specifies the vertical alignment of an element.
+     */
+    String VALIGN = "valign";
+
+    // verbatim
+
+    /**
+     * Whether to draw a border, or box around an element.
+     */
+    String BOXED = "boxed";
+}

Propchange: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/doxia/trunk/doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/SinkEventAttributes.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message