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 Elmström Johan <Jo...@edb.com> on 2005/12/06 20:46:54 UTC
XSLTC template problem
Hi Guys
I am having trouble generating a PDF when using XSLTC, I need to use xsl:templates to avoid a known bug when XSLTC creates its intermediate translet.
However, there's as far as I can tell, a Catch 22 involved..
To be able to put fo:table contents into my xsl:template it needs to be inside the fo:page-sequence element.
This fo:page-sequence is inside the <xsl:template match="/"> tag.
So I need to put my xsl:template that generates my table content inside another xsl:template.
However, i just fpound out this is not allowed in XSLTC (http://issues.apache.org/jira/browse/XALANJ-1733 <http://issues.apache.org/jira/browse/XALANJ-1733> ) .
So... has anyone got a suggestion how I should arrange my xsl:templates in order to enable fo: content??
Any help appreciated.
Mvh
Johan Elmström
----------------------------------------------------
Johan Elmström
EDB Lösningar
E-mail : johan.elmstrom@edb.se <ma...@edb.se>
Tfn : +46(0)737081825
----------------------------------------------------
Re: XSLTC template problem
Posted by Johan <jo...@edb.com>.
> <xsl:template match="/">
> ...
> <fo:page-sequence ...>
> <xsl:apply-templates select="whatever-nodes" />
> </fo:page-sequence>
> </xsl:template>
>
> <xsl:template match="whatever-nodes">
> <fo:table ...>
> <!-- maybe some more xsl:apply-templates or xsl:call-template
> here... -->
> </fo:table>
> </xsl:template>
>
Yeah, but the problem I had with that was always that it complains that the fo
in fo:table inside the whatever temoplate is not bound.
(The prefix "fo" for element "fo:table" is not bound., 'Could not compile
stylesheet')
But then I noticed that the xmlns:fo="" declaration was inside the fo:root node.
I moved it, it works .
Sorry for taking up your time with this. I should have seen that ages ago.
/Johan
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: XSLTC template problem
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Dec 6, 2005, at 20:46, Elmström Johan wrote:
> I am having trouble generating a PDF when using XSLTC, I need to
> use xsl:templates to avoid a known bug when XSLTC creates its
> intermediate translet.
>
> However, there’s as far as I can tell, a Catch 22 involved..
>
> To be able to put fo:table contents into my xsl:template it needs
> to be inside the fo:page-sequence element.
>
> This fo:page-sequence is inside the <xsl:template match="/"> tag.
>
> So I need to put my xsl:template that generates my table content
> inside another xsl:template.
>
> However, i just fpound out this is not allowed in XSLTC (http://
> issues.apache.org/jira/browse/XALANJ-1733) .
Well, that's not specific to XSLTC. You can't do that in XSLT. You
can call or apply templates from within another template, but not
define a new template...
If I get your question correctly, your stylesheet needs to look
something like:
<xsl:template match="/">
...
<fo:page-sequence ...>
<xsl:apply-templates select="whatever-nodes" />
</fo:page-sequence>
</xsl:template>
<xsl:template match="whatever-nodes">
<fo:table ...>
<!-- maybe some more xsl:apply-templates or xsl:call-template
here... -->
</fo:table>
</xsl:template>
The two templates are always defined independently of each other, and
'chained' together using xsl:apply-templates...
Hope you get the picture. If not, don't hesitate to re-post.
HTH!
Cheers,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org