tags:

views:

16

answers:

1

I'm trying to add some additional lines to a table in FOP, to fill them up to 13 rows with this code:

      <!-- Fill Up Empty space -->
      <c:forEach var="i" begin="${position_id}" end="13" step="1">
        <fo:table-row height="4.4mm" border-bottom-color="black"
          border-bottom-style="fixed" border-bottom-width="0.2mm">
          <fo:table-cell border-bottom-style="solid"
            border-bottom-width="0.2mm" border-top-style="solid"
            border-top-width="0.1mm">
            <fo:block font-size="8pt" text-align="center">
            </fo:block>
          </fo:table-cell>
          <fo:table-cell border-bottom-style="solid"
            border-bottom-width="0.2mm" border-top-style="solid"
            border-top-width="0.1mm">
            <fo:block />
          </fo:table-cell>
          <fo:table-cell border-bottom-style="solid"
            border-bottom-width="0.2mm" border-top-style="solid"
            border-top-width="0.1mm">
            <fo:block />
          </fo:table-cell>
          <fo:table-cell border-bottom-style="solid"
            border-bottom-width="0.2mm" border-top-style="solid"
            border-top-width="0.1mm">
            <fo:block />
          </fo:table-cell>
          <fo:table-cell border-bottom-style="solid"
            border-bottom-width="0.2mm" border-top-style="solid"
            border-top-width="0.1mm">
            <fo:block />
          </fo:table-cell>
        </fo:table-row>
      </c:forEach>

Problem is that I keep getting an exception:

org.apache.fop.fo.ValidationException: file:/tmp/fop_1613051806105460695.fo:289:126: Error(289/126): fo:table-row is not a valid child element of forEach.
 at org.apache.fop.fo.FONode.invalidChildError(FONode.java:435)
 at org.apache.fop.fo.FONode.invalidChildError(FONode.java:420)
 at org.apache.fop.fo.XMLObj.validateChildNode(XMLObj.java:70)
    ...

And Googling isn't helping either. Any ideas?

+2  A: 

"c:forEach" is nothing FOP can deal with. Is that some proprietary XML transformation language? At any rate, you'll have to make sure that transformation runs before FOP and FOP only receives plain XSL-FO. Then this error should go away.

Just a note on the FO parts: That table-row may collapse to zero height if there's no content. You may need to use something like block-progression-dimension.minimum="1.2em" on the table-row to avoid that collapsing effect.

Jeremias Märki
Well the c:forEach is just the JSTL Core forEach, and since I'm able to use c:set I have no idea why this isn't working.As for the zero height, I'll try that one, but I was under the impression that by setting the height I also set the block-progresison-dimension.minimum.
cdecker