[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Dynamic Tables in FO

Subject: RE: Dynamic Tables in FO
From: Anthony Ikeda <anthony.ikeda@xxxxxxxxxxxxxxxx>
Date: Fri, 22 Dec 2000 09:41:12 +1100
fo table dynamic
Thanks Jeni, I actually found out what was wrong, I had to change the code
so that the match for jncTable existed in the for each (for some unknown
reason) so I have:

<xsl:template name="111">
	<fo:block font-size="9pt">
		<fo:table>
			<fo:table-column column-width="20mm"/>
			<fo:table-column column-width="90mm"/>
			<fo:table-column column-width="30mm"/>
			<fo:table-body>
			<xsl:choose>
				<xsl:when test="//section/@number='11.1'">"
				<xsl:for-each
select="//jncTable/jncTableRow">
					<fo:table-row>
						<xsl:for-each
select="jncTableHeader | jncTableItem">
							<fo:table-cell>
	
<fo:block><xsl:value-of select="." /></fo:block>
							</fo:table-cell>
						</xsl:for-each>
					</fo:table-row>
				</xsl:for-each>
				</xsl:when>
			</xsl:choose>
			</fo:table-body>
		</fo:table>
	</fo:block>
</xsl:template>

It seems the template declaration for match="jncTable" was causing the
problem.

Thanks,
Anthony Ikeda,
Web Application Developer,
Proxima Technology,

Level 13,
181 Miller Street,
North Sydney
Australia


PH: +612-9458-1718
Mob: 041 624 5143


> -----Original Message-----
> From: Jeni Tennison [mailto:mail@xxxxxxxxxxxxxxxx]
> Sent: Thursday, 21 December 2000 9:40 PM
> To: Anthony Ikeda
> Cc: Xsl-List (E-mail)
> Subject: Re:  Dynamic Tables in FO
> 
> 
> Hi Anthony,
> 
> > Okay, I have some XML code that represents a table structure syntax,
> > much the way it does in html. However, I'm having problems
> > generating the code to PDF.
> 
> One possibility is that you're creating empty table rows, which aren't
> allowed.  The relevant part of the XSLT is:
> 
> >  <xsl:for-each select="./jncTableRow">
> >     <fo:table-row>
> >        <!-- headers section... -->
> >        <xsl:for-each select="./jncTableHeader">
> >           <fo:table-cell>
> >              <fo:block>
> >                 <xsl:value-of select="."/>
> >              </fo:block>
> >           </fo:table-cell>
> >        </xsl:for-each>
> >        <!-- ...headers section -->
> >      </fo:table-row>
> >      <fo:table-row>
> >        <!-- data section... -->
> >        <xsl:for-each select="./jncTableItem">
> >           <fo:table-cell>
> >              <fo:block>
> >                 <xsl:value-of select="."/>
> >              </fo:block>
> >           </fo:table-cell>
> >        </xsl:for-each>
> >        <!-- ...data section -->
> >      </fo:table-row>
> >    </xsl:for-each>
> 
> Here, you're going through each jncTableRow in your XML source, and
> for each of them first making a row that holds cells for each of the
> jncTableHeader elements it holds and then making a row that holds
> cells for each of the jncTableItem elements it holds.  If you look at
> your source XML, only the first jncTableRow holds jncTableHeader
> elements, and it doesn't hold any jncTableItem elements.  So the first
> jncTableRow creates one row with cells in it for each of the headers,
> and another row with nothing in; the rest of the jncTableRows create
> one row with nothing in, and another row holding the items.
> 
> What you want to do is have each of the jncTableRows create a row with
> the a cell for each of the jncTableHeader *or* jncTableItem elements
> that it holds.  [As an aside, you can also stop putting ./ at the
> front of each XPath: it's completely redundant and will just slow
> things down.]  So, you want something like:
> 
>   <xsl:for-each select="jncTableRow">
>      <fo:table-row>
>         <xsl:for-each select="jncTableHeader | jncTableItem">
>            <fo:table-cell>
>               <fo:block><xsl:value-of select="." /></fo:block>
>            </fo:table-cell>
>         </xsl:for-each>
>      </fo:table-row>
>   </xsl:for-each>
> 
> I've no idea whether that will help as I know nothing about XSL-FO,
> but it's probably worth a shot.
> 
> Cheers,
> 
> Jeni
> 
> ---
> Jeni Tennison
> http://www.jenitennison.com/
> 
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.