You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Zahidul Islam <fa...@yahoo.com> on 2003/05/27 05:20:13 UTC

Showing images in different row using xsl-fo

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="{child::url}" 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.

Re: Showing images in different row using xsl-fo

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Zahidul Islam wrote:
> java.lang.RuntimeException
> java.lang.ArrayIndexOutOfBoundException

This looks like a problem specific to an old Xalan release
distributed with JDK 1.4.
Get a recent Xalan distribution and put the Xalan jar inot
the lib/endorsed directory of the JDK.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org