Subject: RE: [xsl] xsl template usage ? From: "sudha rv" <rv_sudha@xxxxxxxxxxx> Date: Wed, 17 Jul 2002 09:37:54 +0000 |
------------------------------ <xsl:template match="html:table"> <xsl:apply-templates select="html:caption"/> </fo:table-caption> <fo:table xsl:use-attribute-sets="table"> <xsl:if test="@width"> <xsl:attribute name="width"><xsl:value-of select="@width" /> <xsl:text>pt</xsl:text></xsl:attribute> </xsl:if>
<xsl:if test="@border"> <xsl:attribute name="border-style"><xsl:value- of select="@border" /></xsl:attribute> </xsl:if> <xsl:attribute name="background-color"><xsl:value- of select="@bgcolor" /></xsl:attribute>
<xsl:apply-templates select="html:thead"/> <xsl:apply-templates select="html:tfoot"/>
<xsl:choose> <xsl:when test="html:tbody"> <xsl:apply-templates select="html:tbody"/> </xsl:when> <xsl:otherwise> <fo:table-body> <xsl:apply-templates select="html:td" mode="contents"/>
<xsl:apply-templates select="html:tr"/> </fo:table-body> </xsl:otherwise> </xsl:choose> </fo:table> </xsl:template> ------------------------------- where u can see two lines <xsl:apply-templates select="html:td" mode="contents"/>
I got the xsl-template definitions like below ---------------------------------------- <xsl:template match="html:tr"> <fo:table-row xsl:use-attribute-sets="tr"> <xsl:apply-templates select="html:th | html:td"/> </fo:table-row> </xsl:template>
<xsl:template match="html:td"> <fo:table-cell xsl:use-attribute-sets="td"> <xsl:call-template name="make-cell" /> </fo:table-cell> </xsl:template>
<xsl:template match="html:td" mode="contents"> <fo:table-column xsl:use-attribute-sets="td"> <xsl:call-template name="make-cell" /> </fo:table-column> </xsl:template> ------------------------------------------
thanks sudha
From: Jarno.Elovirta@xxxxxxxxx
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: [xsl] xsl template usage ? Date: Wed, 17 Jul 2002 11:40:10 +0300
Hi,
> i AM IN NEED OF HELP OF U PEOPLE :( > HERE i AM WRITING AN xsl file to convert my xhtml to fo. > I want to create a fo table in such format that
[snip]
> I have an htm table. now I need to interpret <td> for making tags > > <fo:table-column> and <fo:table-cell>. > I can use > > <xsl:template match="html:td"> > <fo:table-cell xsl:use-attribute-sets="td"> > <xsl:call-template name="make-cell" /> > </fo:table-cell> > </xsl:template> > > for defining table-cell.but I cannot use <xsl:template > match="html:td"> twice for defining both table-cel and table-column. > I tried by using <xsl:foreach> which also didn;t give me the desired > output.
It would help us if you showed us the stylesheet that used xsl:for-each. Anyhow, use modes <http://www.w3.org/TR/xslt#modes> to define multiple templates with the same match pattern.
Cheers,
Santtu
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Sudha einsurance Agency AG Information Technology
Germany ---------------------------------------------------------------------- Unless we ask the right questions.. we won't get the right answers ----------------------------------------------------------------------
_________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xsl template usage ?, Jarno . Elovirta | Thread | RE: [xsl] xsl template usage ?, Jarno . Elovirta |
Re: [xsl] Naming conventions, Vasu Chakkera | Date | Re: [xsl] XML to EXCEL, Francis Norton |
Month |