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 Patrick Mannhart <pa...@bluewin.ch> on 2003/06/09 20:27:51 UTC

Dynamic Table Rows

Hi

I need some important help!

How can I generate dynamical table rows?
I have a xml-file like this

...
<foo>
  <bar>aa</bar>
  <42>bb</42>
</foo>
<foo>
  <bar>xx</bar>
  <42>yy</42>
</foo>

etc.
...

now, I want a table in my xsl-file with 2 columns and n rows - it means each
<foo> is a own row.

One possibility is, to do it like:
<fo:table-row font....>
   <fo:table-cell ....><fo:block><xsl:value-of
select="foo/bar"/></fo:block></fo:table-cell>
   <fo:table-cell ....><fo:block><xsl:value-of
select="foo/42"/></fo:block></fo:table-cell>
</fo:table-row>

<fo:table-row font...>
... etc. etc. ....

What is the best way?
Thanks a lot for help!!
Patrick


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


Re: Dynamic Table Rows

Posted by Mike Ferrando <mi...@yahoo.com>.
Patrick,
This is a basic XSL question. However, based on what you have said
and your XML example, here is my attempt.

If you need more help e-mail me personally.


Mike F.

<xsl:template match="foo">
  <fo:table-row font....>
    <xsl:apply-templates select="*" mode="special"/>
  </fo:table-row>
</xsl:template>

<xsl:template match="*" mode="special">
  <fo:table-cell ....>
   <fo:block>
    <xsl:value-of select="."/>
   </fo:block>
  </fo:table-cell>
</xsl:template>


--- Patrick Mannhart <pa...@bluewin.ch> wrote:
> Hi
> 
> I need some important help!
> 
> How can I generate dynamical table rows?
> I have a xml-file like this
> 
> ...
> <foo>
>   <bar>aa</bar>
>   <42>bb</42>
> </foo>
> <foo>
>   <bar>xx</bar>
>   <42>yy</42>
> </foo>
> 
> etc.
> ...
> 
> now, I want a table in my xsl-file with 2 columns and n rows - it
> means each
> <foo> is a own row.
> 
> One possibility is, to do it like:
> <fo:table-row font....>
>    
>    <fo:table-cell ....><fo:block><xsl:value-of
> select="foo/42"/></fo:block></fo:table-cell>
> </fo:table-row>
> 
> <fo:table-row font...>
> ... etc. etc. ....
> 
> What is the best way?
> Thanks a lot for help!!
> Patrick
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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