|
Subject: Re: [xsl] Applying templates From: "Barry van Weldam" <barry@xxxxxxx> Date: Mon, 24 Nov 2003 13:51:59 +0100 |
Hmm,
Recreated my xsl without typos etc.
Now i don't get a parse error, but my data isn't showing
<fo:flow flow-name="xsl-region-body">
<fo:table width="100%" >
<fo:table-column column-width="17mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="16mm"/>
<fo:table-column column-width="10mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="12mm"/>
<fo:table-header text-align="center" font-size="12px" font-weight="bold">
<fo:table-row background-color="#DC9F34">
<xsl:apply-templates select="Header" />
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:apply-templates select="Row" />
</fo:table-body>
</fo:table>
</fo:flow>
....
with these templates
<!-- try template for the header values -->
<xsl:template match="Header">
<fo:table-cell border="solid black 1px">
<xsl:apply-templates select="*" />
</fo:table-cell>
</xsl:template>
<xsl:template match="Header/*">
<fo:block><xsl:value-of select="node()"/></fo:block>
</xsl:template>
<!-- for each row i select a tmpl per celldo -->
<xsl:template match="Row">
<fo:table-row text-align="right" font-size="10px" >
<xsl:apply-templates select="*" />
</fo:table-row>
</xsl:template>
<!--Here i use a tmpl for each cell -->
<xsl:template match="Row/*">
<fo:table-cell border="solid black 1 px" border-collapse="collapse" padding-right="5px" padding-top="3px">
<fo:block>
<xsl:value-of select="node()[not(.='null')]"/>
</fo:block>
</fo:table-cell>
</xsl:template>
----- Original Message -----
From: "Barry van Weldam" <barry@xxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, November 24, 2003 12:59 PM
Subject: [xsl] Applying templates
Hi,
I am trying to recreate my xsl file with the use of templates.
Somehow i have get the Row part working but the Header part not.
Any suggestions?
This is a part of my .xsl file
<fo:flow flow-name="xsl-region-body">
<fo:table width="100%" >
<fo:table-column column-width="17mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="16mm"/>
<fo:table-column column-width="10mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="12mm"/>
<fo:table-header text-align="center" font-size="12px" font-weight="bold">
<fo:table-row background-color="#DC9F34">
<xsl:apply-templates select="Header"/>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:apply-templates />
</fo:table-body>
</fo:table>
</fo:flow>
.....
........
<!-- try template for the header values -->
<xsl:template match="Header">
<fo:table-cell border="solid black 1px">
<fo:block><xsl:value-of select="node()"/></fo:block>
</fo:table-cell>
</xsl>
<!-- for each row i select a tmpl per celldo -->
<xsl:template match="Row">
<fo:table-row text-align="right" font-size="10px" >
<xsl:apply-templates select="*" />
</fo:table-row>
</xsl:template>
<!--Here i use a tmpl for each cell -->
<xsl:template match="Row/*">
<fo:table-cell border="solid black 1 px" border-collapse="collapse" padding-right="5px" padding-top="3px">
<fo:block>
<xsl:value-of select="node()[not(.='null')]"/>
</fo:block>
</fo:table-cell>
</xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Applying templates, Barry van Weldam | Thread | Re: [xsl] Applying templates, David Carlisle |
| Re: [xsl] crossreferencing any elem, David Carlisle | Date | [xsl] XSLT to XSLT, Bruno LLopes |
| Month |