|
Subject: Re: [xsl] How to integrate XSLT tags with FO tags From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sun, 12 Apr 2009 13:17:43 -0400 |
I began to study XSL 2 weeks ago, now I don't understand how to integrate XSLT tags with FO tags in a single .xsl file. For example:
<?xml version="1.0" encoding="UTF-8"?> <?xsl:stylesheet type="text/xsl" href="person.xsl"?> <person first-name="Kui" last-name="Liu"/>
In order to format the .xml file above, I want to use the following .xsl file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3c.org/1999/XSL/Transform" xmlns:fo="http://www.w3c.org/1999/XSL/Format">
<xsl:template match="person"> <fo:block border="thick silver ridge"> <xsl:value-of select="@last-name"/> <xsl:text> </xsl:text> <xsl:value-of select="@first-name"/> </fo:block> </xsl:template> </xsl:stylesheet>
But it seems that the FOP can not generate valid .pdf file from these two files above,
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"><xsl:template match="/"> <fo:root font-family="Times" font-size="20pt">
<fo:layout-master-set>
<fo:simple-page-master master-name="frame"
page-width="210mm" page-height="297mm"
margin-top="1cm" margin-bottom="1cm"
margin-left="1cm" margin-right="1cm">
<fo:region-body region-name="frame-body"/>
</fo:simple-page-master>
</fo:layout-master-set> <fo:page-sequence master-reference="frame">
<fo:flow flow-name="frame-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template><xsl:template match="person"> <fo:block border="thick silver ridge"> <xsl:value-of select="@last-name"/> <xsl:text> </xsl:text> <xsl:value-of select="@first-name"/> </fo:block> </xsl:template> </xsl:stylesheet>
and <fo:foot> tag doesn't coexist with <xsl:stylesheet> tag.
What's more, I find that Windows IE fails to recognise .fo file, which makes me a little confused.
Could anyone be so kind as to explain these problems to me?
-- XSLT/XSL-FO/XQuery training in Los Angeles (New dates!) 2009-06-08 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
| Current Thread |
|---|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] How to integrate XSLT tags wi, LiuKui | Thread | [xsl] How to handle dynamic XPath, fred |
| [xsl] How to integrate XSLT tags wi, LiuKui | Date | [xsl] How to handle dynamic XPath, fred |
| Month |