FOP
  1. FOP
  2. FOP-1194

NullPointerExeption on table with border-separation="[value]"

    Details

    • External issue ID:
      39712

      Description

      In the new FOP Version we got the NullPointerExeption always when we use the
      attribute "border-separation" on table. This bug is easy to find. Try the
      following xsl.

      Background: the new altova stylevision 2006 make intensive use of border-
      separation when you want to design tables. The previous version had a different
      handling. That was the reason why the bug was discovered.
      Because of the advantages of FOP 0.92 we don't want to go back to FOP 0.20.5
      (this Version has no problems).

      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fo="http://www.w3.org/1999/XSL/Format"
      xmlns:fn="http://www.w3.org/2005/xpath-functions"
      xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
      xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xsl:output version="1.0" method="html" encoding="UTF-8" indent="no" />
      <xsl:variable name="fo:layout-master-set">
      <fo:layout-master-set>
      <fo:simple-page-master master-name="default-page" page-
      height="11in" page-width="8.5in" margin-left="0.6in" margin-right="0.6in">
      <fo:region-body margin-top="0.79in" margin-bottom="0.79in" />
      </fo:simple-page-master>
      </fo:layout-master-set>
      </xsl:variable>
      <xsl:template match="/">
      <xsl:variable name="maxwidth" select="7.30000" />
      <fo:root>
      <xsl:copy-of select="$fo:layout-master-set" />
      <fo:page-sequence master-reference="default-page" initial-page-
      number="1" format="1">
      <fo:flow flow-name="xsl-region-body">
      <fo:block>
      <xsl:variable name="tablewidth0" select="$maxwidth *
      1.00000" />
      <xsl:variable name="sumcolumnwidths0"
      select="0.04167" />
      <xsl:variable name="defaultcolumns0" select="1" />
      <xsl:variable name="defaultcolumnwidth0">
      <xsl:choose>
      <xsl:when test="$defaultcolumns0 > 0">
      <xsl:value-of select="($tablewidth0 -
      $sumcolumnwidths0) div $defaultcolumns0" />
      </xsl:when>
      <xsl:otherwise>
      <xsl:value-of select="0.000" />
      </xsl:otherwise>
      </xsl:choose>
      </xsl:variable>
      <xsl:variable name="columnwidth0_0"
      select="$defaultcolumnwidth0" />
      <fo:table table-layout="fixed" width="{$tablewidth0}in"
      space-before.optimum="1pt" space-after.optimum="2pt" border-collapse="separate"
      border-separation="0.04167in" color="black" display-align="center">
      <fo:table-column column-width="{$columnwidth0_0}
      in" />
      <fo:table-body>
      <fo:table-row>
      <fo:table-cell padding-top="0.02083in"
      padding-bottom="0.02083in" padding-left="0.02083in" padding-right="0.02083in">
      <fo:block padding-top="1pt" padding-
      bottom="1pt">
      <fo:inline>
      <xsl:text>fg</xsl:text>
      </fo:inline>
      </fo:block>
      </fo:table-cell>
      </fo:table-row>
      </fo:table-body>
      </fo:table>
      </fo:block>
      </fo:flow>
      </fo:page-sequence>
      </fo:root>
      </xsl:template>
      </xsl:stylesheet>

        Issue Links

          Activity

          Hide
          Andreas L. Delmelle added a comment -

          Sorry for the delay in responding to this...

          Confirmed: I altered our testcase 'table-border-separate3.xml' to use border-separation="...", and the
          test no longer completes succesfully, although I don't receive a NPE during the test cycle (again: a
          completely empty area tree is the result).

          Running the FO standalone throws an NPE with the following stack trace:

          java.lang.NullPointerException
          at org.apache.fop.fo.properties.CompoundPropertyMaker.convertProperty
          (CompoundPropertyMaker.java:172)
          at org.apache.fop.fo.properties.LengthPairProperty$Maker.convertProperty
          (LengthPairProperty.java:61)
          at org.apache.fop.fo.properties.PropertyMaker.make(PropertyMaker.java:437)
          at org.apache.fop.fo.properties.CompoundPropertyMaker.make(CompoundPropertyMaker.java:
          212)
          at org.apache.fop.fo.PropertyList.convertAttributeToProperty(PropertyList.java:355)
          at org.apache.fop.fo.PropertyList.addAttributesToList(PropertyList.java:305)
          at org.apache.fop.fo.FObj.processNode(FObj.java:122)
          at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:318)
          at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)

          Show
          Andreas L. Delmelle added a comment - Sorry for the delay in responding to this... Confirmed: I altered our testcase 'table-border-separate3.xml' to use border-separation="...", and the test no longer completes succesfully, although I don't receive a NPE during the test cycle (again: a completely empty area tree is the result). Running the FO standalone throws an NPE with the following stack trace: java.lang.NullPointerException at org.apache.fop.fo.properties.CompoundPropertyMaker.convertProperty (CompoundPropertyMaker.java:172) at org.apache.fop.fo.properties.LengthPairProperty$Maker.convertProperty (LengthPairProperty.java:61) at org.apache.fop.fo.properties.PropertyMaker.make(PropertyMaker.java:437) at org.apache.fop.fo.properties.CompoundPropertyMaker.make(CompoundPropertyMaker.java: 212) at org.apache.fop.fo.PropertyList.convertAttributeToProperty(PropertyList.java:355) at org.apache.fop.fo.PropertyList.addAttributesToList(PropertyList.java:305) at org.apache.fop.fo.FObj.processNode(FObj.java:122) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:318) at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
          Hide
          Andreas L. Delmelle added a comment -

          FWIW, just ran a second test, specifying the border-separation fully, like:

          border-separation.block-progression-direction="..."
          border-separation.inline-progression-direction="..."

          and then the test completes succesfully.

          Show
          Andreas L. Delmelle added a comment - FWIW, just ran a second test, specifying the border-separation fully, like: border-separation.block-progression-direction="..." border-separation.inline-progression-direction="..." and then the test completes succesfully.
          Hide
          Andreas L. Delmelle added a comment -

          Fixed in FOP Trunk: http://svn.apache.org/viewvc?rev=412714&view=rev

          Thanks for reporting!

          Show
          Andreas L. Delmelle added a comment - Fixed in FOP Trunk: http://svn.apache.org/viewvc?rev=412714&view=rev Thanks for reporting!
          Hide
          Andreas L. Delmelle added a comment -
              • FOP-1221 has been marked as a duplicate of this bug. ***
          Show
          Andreas L. Delmelle added a comment - FOP-1221 has been marked as a duplicate of this bug. ***
          Hide
          Andreas L. Delmelle added a comment -
              • FOP-1263 has been marked as a duplicate of this bug. ***
          Show
          Andreas L. Delmelle added a comment - FOP-1263 has been marked as a duplicate of this bug. ***
          Hide
          Glenn Adams added a comment -

          batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          Show
          Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

            People

            • Assignee:
              fop-dev
              Reporter:
              diethard
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development