XSL:FO tag for repetetive child node
Hi all,
I trying to transform the xml to pdf using the xsl:fo.
I am new to this..i got stucked at one tag which should pull all the repetive child elements with in the parent element..
eg:
<sop_content>
<method_content>
<main_content/>
<main_image/>
<main_image/>
<main_image/>
</method_content>
<method_content>
<main_content/>
<main_image/>
<main_image/>
<main_image/>
</method_content>
</sop_content>
from the above xml..for each method_content i have to copy all the main_image elements into one coulmn..
for that i am using this code:
<xsl:for-each select="/sop_content/method_content">
<fo:table-row >
<fo:table-cell>
<fo:block>
<xsl:apply-templates select="main_content"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:apply-templates select="main_image"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
<xsl:template match="main_content">
<xsl:apply-templates select="./*"/>
</xsl:template>
<xsl:template match="main_image">
<xsl:variable name="imageURI"><xsl:value-of select="./node()"/></xsl:variable>
<xsl:if test="string-length($imageURI)>0">
<xsl:variable name="imgSrc"><xsl:value-of select="." /></xsl:variable>
<fo:external-graphic src="url({concat($pathToGraphics,'/',$imgSrc)})" content-width="scale-to-fit" content-height="scale-to-fit" width="6.25in"/>
</xsl:if>
</xsl:template>
but i am not able to get all the images in the pdf after getting transformed. Only the first image is visible on the pdf.
Can any of you suggest me which condition needs to be used to get all the images on the pdf.. Thanks in advance..
bug
|