Loading ...
Sorry, an error occurred while loading the content.
 

Re: [XSL-FO] ArrayIndexOutOfBoundsException

Expand Messages
  • PRAVEEN SAM
    Do you have your xsl:fo for this? Cant remember top off my head .. but have encountered this before and it was bcos my xsl:fo was not handling the complete xml
    Message 1 of 5 , May 6, 2003
      Do you have your xsl:fo for this?

      Cant remember top off my head .. but have encountered
      this before and it was bcos my xsl:fo was not handling
      the complete xml properly ... check your xml and
      xsl:fo and you would be able to figure out or attach
      your stylesheet along with the xml ...

      cheers
      P

      --- duyee <duyee@...> wrote:
      > Hi!
      > Anyone has a clue about this exception ???
      >
      > java.lang.ArrayIndexOutOfBoundsException
      > at
      >
      org.apache.fop.fo.flow.TableRow$CellArray.getNextFreeCell
      > (TableRow.java:86)
      > at
      >
      org.apache.fop.fo.flow.TableRow.initCellArray(TableRow.java:452)
      > at
      >
      org.apache.fop.fo.flow.TableRow.layout(TableRow.java:226)
      > at org.apache.fop.fo.flow.AbstractTableBody.layout
      > (AbstractTableBody.java:179)
      > at
      > org.apache.fop.fo.flow.Table.layout(Table.java:245)
      > at
      >
      org.apache.fop.fo.flow.TableCell.layout(TableCell.java:274)
      > at
      >
      org.apache.fop.fo.flow.TableRow.layout(TableRow.java:307)
      > at org.apache.fop.fo.flow.AbstractTableBody.layout
      > (AbstractTableBody.java:179)
      > at
      > org.apache.fop.fo.flow.Table.layout(Table.java:245)
      > at
      >
      org.apache.fop.fo.flow.TableCell.layout(TableCell.java:274)
      > at
      >
      org.apache.fop.fo.flow.TableRow.layout(TableRow.java:307)
      > at org.apache.fop.fo.flow.AbstractTableBody.layout
      > (AbstractTableBody.java:179)
      > at
      > org.apache.fop.fo.flow.Table.layout(Table.java:245)
      > at
      > org.apache.fop.fo.flow.Block.layout(Block.java:206)
      > at
      > org.apache.fop.fo.flow.Block.layout(Block.java:206)
      > at
      >
      org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:111)
      > at
      >
      org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:68)
      > at
      > org.apache.fop.fo.pagination.PageSequence.makePage
      > (PageSequence.java:352)
      > at org.apache.fop.fo.pagination.PageSequence.format
      > (PageSequence.java:290)
      > at
      >
      org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:210)
      > at
      >
      org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
      > at
      >
      org.apache.fop.tools.DocumentReader.parse(DocumentReader.java:461)
      > at
      > org.apache.fop.apps.Driver.render(Driver.java:457)
      > at
      > org.apache.fop.apps.Driver.render(Driver.java:477)
      > at
      >
      com.jdm.util.PDFByteArray.getByteArray(PDFByteArray.java:76)
      > at
      >
      com.delphi.dssp.handlers.ForwardToHandler.processRequest
      > (ForwardToHandler.java:91)
      > at
      >
      com.delphi.dssp.servlet.MainServlet.dispatch(MainServlet.java:374)
      > at
      >
      com.delphi.dssp.servlet.MainServlet.doGet(MainServlet.java:294)
      > at
      >
      com.delphi.dssp.servlet.MainServlet.doPost(MainServlet.java:131)
      > at
      >
      javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      > at
      >
      javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      > at
      >
      weblogic.servlet.internal.ServletStubImpl.invokeServlet
      > (ServletStubImpl.java:213)
      > at
      >
      weblogic.servlet.internal.WebAppServletContext.invokeServlet
      > (WebAppServletContext.java:1265)
      > at
      > weblogic.servlet.internal.ServletRequestImpl.execute
      > (ServletRequestImpl.java:1631)
      > at
      >
      weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
      > at
      >
      weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
      >
      >
      > Thanks,
      > sateesh
      >
      >


      =====


      __________________________________
      Do you Yahoo!?
      The New Yahoo! Search - Faster. Easier. Bingo.
      http://search.yahoo.com
    • vvelu
      Folks: Here is a problem for which I want to know if the XSL given below is wrong or FOP 0.20.4 has a bug. The requirement is that a cell has to span TWO ROWS
      Message 2 of 5 , Jul 22, 2003
        Folks:

        Here is a problem for which I want to know if
        the XSL given below is wrong or FOP 0.20.4
        has a bug.

        The requirement is that a cell has to span TWO
        ROWS and 3 columns as shown in the table below.

        +----------------------------------------+
        | Col1 | Col2 | Col3 | Col4 | Col5 | Col6|
        +------+------+------+------+------+-----+
        | 123 | 123 | 123 | abc | asdd | vbdg|
        |------+------+------+------+------+-----+
        |Some description | qwer | 123g | lslk|
        |spans 2 rows and 3 |------+------+-----+
        |Columns | blah | blah | blah|
        |--------------------+------+------+-----+
        | and so on.........

        This supposedly can be achieved by the
        following XSL code segment:

        ...
        <fo:table-row>
        <fo:table-cell border="solid black .75px"
        number-rows-spanned="2" number-columns-spanned="3">
        <fo:block>
        <xsl:value-of select="condition"/>
        </fo:block>
        </fo:table-cell>
        </fo:table-row>
        ...

        However, the FOP throws an ArrayIndexOutOfBoundsException,
        which, I think is a valid exception because the second
        row has not been created yet (the XSL however, says span
        to the row that is not created).

        I think there has to be a solution for a trivial issue
        like this. I would greatly appreciate the discussion
        group's help to solve this.

        Thanks
        Sam Velu
      • Rob Stote
        This is a possiblility: Inserting a place holder row, after the row that spans. See example: WARNING: I have no idea if this solution is portable, or if this
        Message 3 of 5 , Jul 22, 2003
          This is a possiblility:

          Inserting a place holder row, after the row that spans. See example:

          WARNING: I have no idea if this solution is portable, or if this is a work
          around to a bug.

          STYLESHEET:

          <?xml version="1.0" encoding="UTF-8"?>
          <!--
          Author: Rob Stote
          Date: 07/22/2003
          Purpose: Testing Purposes
          -->
          <xsl:stylesheet version="1.0"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:fo="http://www.w3.org/1999/XSL/Format">

          <xsl:template match="/">
          <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

          <fo:layout-master-set>

          <fo:simple-page-master page-height="297mm"
          page-width="210mm" master-name="testing">
          <fo:region-body
          region-name="reg-body" margin="3cm"/>
          <fo:region-before
          region-name="reg-before" extent="3cm"/>
          <fo:region-after
          region-name="reg-after" extent="3cm"/>
          <fo:region-start
          region-name="reg-start" extent="3cm"/>
          <fo:region-end region-name="reg-end"
          extent="3cm"/>
          </fo:simple-page-master>

          <fo:page-sequence-master master-name="test">
          <fo:single-page-master-reference
          master-reference="testing"/>
          </fo:page-sequence-master>
          </fo:layout-master-set>

          <fo:page-sequence master-reference="testing">
          <fo:flow flow-name="reg-body">

          <fo:block>Row And Column Span
          Table</fo:block>
          <!-- spacers -->

          <fo:block
          space-after.conditionality="retain" space-after="20pt"/>

          <xsl:call-template
          name="table-one"></xsl:call-template>

          </fo:flow>
          </fo:page-sequence>

          </fo:root>
          </xsl:template>

          <!-- funky table data -->
          <xsl:template name="table-one">
          <fo:table table-layout="fixed" width="15.0cm">
          <fo:table-column width="2.5cm"/>
          <fo:table-column width="2.5cm"/>
          <fo:table-column width="2.5cm"/>
          <fo:table-column width="2.5cm"/>
          <fo:table-column width="2.5cm"/>
          <fo:table-column width="2.5cm"/>

          <fo:table-header>
          <fo:table-row>
          <fo:table-cell><fo:block>Table
          One</fo:block></fo:table-cell>
          </fo:table-row>
          </fo:table-header>
          <fo:table-body>
          <xsl:for-each select="page/row">
          <xsl:choose>

          <xsl:when
          test="@name='funky'">


          <fo:table-row>


          <fo:table-cell border="solid black .75px" number-columns-spanned="3"
          number-rows-spanned="2">

          <fo:block><xsl:value-of select="col2"/></fo:block>

          </fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col4"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col5"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col6"/></fo:block></fo:table-cell>


          </fo:table-row>
          <!-- second
          row to handle the data after the spanned row -->

          <fo:table-row>

          <!--left out the first three cells of this row -->

          <fo:table-cell><fo:block><xsl:value-of
          select="col4"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col5"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col6"/></fo:block></fo:table-cell>


          </fo:table-row>

          <!-- <xsl:call-template
          name="funky-table"></xsl:call-template>-->

          </xsl:when>

          <xsl:otherwise>

          <fo:table-row>

          <fo:table-cell><fo:block><xsl:value-of
          select="col1"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col2"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col3"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col4"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col5"/></fo:block></fo:table-cell>


          <fo:table-cell><fo:block><xsl:value-of
          select="col6"/></fo:block></fo:table-cell>


          </fo:table-row>
          </xsl:otherwise>

          </xsl:choose>
          </xsl:for-each>
          </fo:table-body>
          </fo:table>
          </xsl:template>
          </xsl:stylesheet>



          DATA:

          <?xml version="1.0" encoding="UTF-8"?>
          <page>
          <row>
          <col1>Row 1 Col1</col1>
          <col2>Row 1 Col2</col2>
          <col3>Row 1 Col3</col3>
          <col4>Row 1 Col4</col4>
          <col5>Row 1 Col5</col5>
          <col6>Row 1 Col6</col6>
          </row>
          <row>
          <col1>Row 2 Col1</col1>
          <col2>Row 2 Col2</col2>
          <col3>Row 2 Col3</col3>
          <col4>Row 2 Col4</col4>
          <col5>Row 2 Col5</col5>
          <col6>Row 2 Col6</col6>
          </row>
          <row name="funky">
          <col1>Funky 1</col1>
          <col2>THIS IS WIERD TEXT THAT SPANS</col2>
          <col3>funky 3</col3>
          <col4>funky 4</col4>
          <col5>funky 5</col5>
          <col6>funky 6</col6>
          </row>
          <row>
          <col1>Row 3 Col1</col1>
          <col2>Row 3 Col2</col2>
          <col3>Row 3 Col3</col3>
          <col4>Row 3 Col4</col4>
          <col5>Row 3 Col5</col5>
          <col6>Row 3 Col6</col6>
          </row>
          <row>
          <col1>Row 4 Col1</col1>
          <col2>Row 4 Col2</col2>
          <col3>Row 4 Col3</col3>
          <col4>Row 4 Col4</col4>
          <col5>Row 4 Col5</col5>
          <col6>Row 4 Col6</col6>
          </row>
          <row>
          <col1>Row 5 Col1</col1>
          <col2>Row 5 Col2</col2>
          <col3>Row 5 Col3</col3>
          <col4>Row 5 Col4</col4>
          <col5>Row 5 Col5</col5>
          <col6>Row 5 Col6</col6>
          </row>
          <row name="funky">
          <col1>Funky 2</col1>
          <col2>THIS IS WIERD TEXT THAT SPANS 3 COLS and 2 ROWS</col2>
          <col3>funky 3</col3>
          <col4>funky 4</col4>
          <col5>funky 5</col5>
          <col6>funky 6</col6>
          </row>
          <row>
          <col1>Row 6 Col1</col1>
          <col2>Row 6 Col2</col2>
          <col3>Row 6 Col3</col3>
          <col4>Row 6 Col4</col4>
          <col5>Row 6 Col5</col5>
          <col6>Row 6 Col6</col6>
          </row>
          <row>
          <col1>Row 7 Col1</col1>
          <col2>Row 7 Col2</col2>
          <col3>Row 7 Col3</col3>
          <col4>Row 7 Col4</col4>
          <col5>Row 7 Col5</col5>
          <col6>Row 7 Col6</col6>
          </row>
          </page>

          -----Original Message-----
          From: vvelu [mailto:vvelu@...]
          Sent: Tuesday, July 22, 2003 12:18 PM
          To: XSL-FO@yahoogroups.com
          Subject: [XSL-FO] ArrayIndexOutOfBoundsException


          Folks:

          Here is a problem for which I want to know if
          the XSL given below is wrong or FOP 0.20.4
          has a bug.

          The requirement is that a cell has to span TWO
          ROWS and 3 columns as shown in the table below.

          +----------------------------------------+
          | Col1 | Col2 | Col3 | Col4 | Col5 | Col6|
          +------+------+------+------+------+-----+
          | 123 | 123 | 123 | abc | asdd | vbdg|
          |------+------+------+------+------+-----+
          |Some description | qwer | 123g | lslk|
          |spans 2 rows and 3 |------+------+-----+
          |Columns | blah | blah | blah|
          |--------------------+------+------+-----+
          | and so on.........

          This supposedly can be achieved by the
          following XSL code segment:

          ...
          <fo:table-row>
          <fo:table-cell border="solid black .75px"
          number-rows-spanned="2" number-columns-spanned="3">
          <fo:block>
          <xsl:value-of select="condition"/>
          </fo:block>
          </fo:table-cell>
          </fo:table-row>
          ...

          However, the FOP throws an ArrayIndexOutOfBoundsException,
          which, I think is a valid exception because the second
          row has not been created yet (the XSL however, says span
          to the row that is not created).

          I think there has to be a solution for a trivial issue
          like this. I would greatly appreciate the discussion
          group's help to solve this.

          Thanks
          Sam Velu


          ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy
          Ink Cartridges & Refill Kits for Your Epson at Myinks.com Free shipping on
          orders $50 or more to the US and Canada.
          http://www.c1tracking.com/l.asp?cid=5705&lp=home/epson.asp
          http://us.click.yahoo.com/brYXfA/_xWGAA/ySSFAA/9rHolB/TM
          ---------------------------------------------------------------------~->

          To unsubscribe from this group, send an email to:
          XSL-FO-unsubscribe@egroups.com



          Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.