let my xml is as follows:

<images>
 <image id="1">
  <url>1.jpg</url>
  <imagename>image1</imagename>
 </image>
 <image id="2">
  <url>2.jpg</url>
  <imagename>image2</imagename>
 </image>
 <image id="3">
  <url>3.jpg</url>
  <imagename>image3</imagename>
 </image>
 <image id="4">
  <url>4.jpg</url>
  <imagename>image4</imagename>
 </image>
 .
 .
 .
</images>

here <image> element can of any number (Here for
example shown 3, it may be 4,5,6..). and i want to
show 2 of them in the pdf in 1 row and next 2 will
in the next row and so on.. So if i have 2 <image>
they will be shown in 1 row , if i have 5 <image>
element they will be shown in three row..For this
purpose i tried the following code :

<xsl:template match="images">
<fo:table>
 <fo:table-column column-width="105px"/>
 <fo:table-column column-width="105px"/>
 <fo:table-body>
 <fo:table-row>
     <xsl:for-each select="child::image">
 <fo:table-cell height="120px" width="105px" border-style="solid">
 <fo:block>
 <fo:external-graphic src="" content-height="100px" content-width="100px" height="100px" width="100px"/>
 </fo:block>
 </fo:table-cell>
 </xsl:for-each>
 </fo:table-row>
 </fo:table-body>
</fo:table>
</xsl:template>

If the no of <image> it works fine but for 5,6.. it shows
the following exception is shown :
java.lang.RuntimeException
java.lang.ArrayIndexOutOfBoundException


How can i solve it?
pls help me.


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

Reply via email to