Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-455

No XML Entity Encoding (Escaping) is done in FO Footer Generation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2, 1.3
    • 1.4
    • Module - FO
    • None
    • Patch

    Description

      When using an ampersand in the pom.xml organization.name e.g. "Some Company & Friends" the resulting fo file has xml parse errors.

      Soulution seems to be:

      ### Eclipse Workspace Patch 1.0
      #P doxia-module-fo
      Index: src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
      ===================================================================
      --- src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java	(revision 1205142)
      +++ src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java	(working copy)
      @@ -733,7 +733,7 @@
                   actualYear = Calendar.getInstance().get( Calendar.YEAR );
               }
       
      -        return "©" + actualYear + ", " + companyName + add;
      +        return "©" + actualYear + ", " + escaped(companyName, false) + add;
           }
       
           /**
      @@ -826,11 +826,11 @@
       
               if ( headerText == null )
               {
      -            write( docTitle );
      +            text( docTitle );
               }
               else
               {
      -            write( headerText );
      +            text( headerText );
               }
       
               writeEndTag( BLOCK_TAG );
      @@ -927,7 +927,7 @@
                   atts.addAttribute( "text-align-last", "justify" );
                   writeStartTag( BLOCK_TAG, atts );
                   writeStartTag( BASIC_LINK_TAG, "internal-destination", ref );
      -            write( tocItem.getName() );
      +            text( tocItem.getName() );
                   writeEndTag( BASIC_LINK_TAG );
                   writeEmptyTag( LEADER_TAG, "toc.leader.style" );
                   writeStartTag( INLINE_TAG, "page.number" );
      @@ -985,7 +985,7 @@
       
                   writeStartTag( BOOKMARK_TAG, "internal-destination", ref );
                   writeStartTag( BOOKMARK_TITLE_TAG );
      -            write( tocItem.getName() );
      +            text( tocItem.getName() );
                   writeEndTag( BOOKMARK_TITLE_TAG );
       
                   if ( tocItem.getItems() != null )
      @@ -1134,7 +1134,7 @@
       
               writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "2", "cover.border.left" );
               writeStartTag( BLOCK_TAG, "cover.title" );
      -        write( title == null ? "" : title );
      +        text( title == null ? "" : title );
               writeEndTag( BLOCK_TAG );
               writeEndTag( TABLE_CELL_TAG );
               writeEndTag( TABLE_ROW_TAG );
      @@ -1146,10 +1146,10 @@
       
               writeStartTag( TABLE_CELL_TAG, "number-columns-spanned", "2", "cover.border.left.bottom" );
               writeStartTag( BLOCK_TAG, "cover.subtitle" );
      -        write( subtitle == null ? ( version == null ? "" : " v. " + version ) : subtitle );
      +        text( subtitle == null ? ( version == null ? "" : " v. " + version ) : subtitle );
               writeEndTag( BLOCK_TAG );
               writeStartTag( BLOCK_TAG, "cover.subtitle" );
      -        write( type == null ? "" : type );
      +        text( type == null ? "" : type );
               writeEndTag( BLOCK_TAG );
               writeEndTag( TABLE_CELL_TAG );
               writeEndTag( TABLE_ROW_TAG );
      @@ -1214,7 +1214,7 @@
               att.addAttribute( "height", "0.3in" );
               att.addAttribute( "text-align", "left" );
               writeStartTag( BLOCK_TAG, att );
      -        write( compName == null ? ( cover.getAuthor() == null ? "" : cover.getAuthor() ) : compName );
      +        text( compName == null ? ( cover.getAuthor() == null ? "" : cover.getAuthor() ) : compName );
               writeEndTag( BLOCK_TAG );
               writeEndTag( TABLE_CELL_TAG );
       
      @@ -1223,7 +1223,7 @@
               att.addAttribute( "height", "0.3in" );
               att.addAttribute( "text-align", "right" );
               writeStartTag( BLOCK_TAG, att );
      -        write( date == null ? "" : date );
      +        text( date == null ? "" : date );
               writeEndTag( BLOCK_TAG );
               writeEndTag( TABLE_CELL_TAG );
       

      Attachments

        1. test case patch.txt
          3 kB
          Birger Zimmermann
        2. doxia-module-fo-test.zip
          2 kB
          Birger Zimmermann
        3. patch.txt
          3 kB
          Birger Zimmermann

        Activity

          People

            rfscholte Robert Scholte
            birgerzim Birger Zimmermann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: