This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problems with FO


Good evening:

I'm working with the cocoon publishing framework. I gor the following
stylesheet, but it keeps changing the DTD of the page I've just created to
the strict HTML dtd.

What am I doing wrong? Is it fop or is it XSLT?

Thanks
Carlos

<?xml version="1.0"?>
<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="/">
	<xsl:apply-templates select="book"/>
</xsl:template>


<xsl:template match="book">
<xsl:processing-instruction name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>
	<fo:simple-page-master
		page-master-name="title"
		margin-top="150pt"
		margin-bottom="50pt"
		margin-left="150pt"
		margin-right="150pt">

        <fo:simple-page-master
		page-master-name="body"
		margin-top="75pt"
		margin-bottom="25pt"
		margin-left="75pt"
		margin-right="75pt">


	<fo:region-body margin-bottom="50pt"/>

	<fo:region-after extent="25pt"/>	
		</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence>
	<fo:sequence-specification>
	<fo:sequence-specifier-alternating
    		page-master-first="title"
		page-master-odd="body"
		page-master-even="body"/>
	</fo:sequence-specification>


<fo:static-content flow-name="xsl-after">

	<fo:block text-align-last="centered" font-size="10pt">
		<xsl:text>Page </xsl:text><fo:page-number/>
	</fo:block>
</fo:static-content>

	<fo:flow>
		<xsl:apply-templates select="book"/>
	</fo:flow>
</fo:page-sequence>

</fo:root>
</xsl:template>


<xsl-template match="book">
	<xsl:apply-templates select="*"/>
</xsl-template>

  <xsl:template match="fm">
    <fo:block text-align="centered" font-size="24pt" line-height="27pt"
font-family="serif" space-after.optimum="18pt">
    	<xsl:value-of select="book_title" />
		<xsl:value-of select="author" />
        </fo:block>
	<fo:block text-align="centered" font-size="18pt"
line-height="27pt"  font-family="serif" space-after.optimum="18pt">
		<xsl:value-of select="edition" />
		<xsl:value-of select="edition_date" />
	</fo:block>
		<fo:block text-align="centered" font-size="14pt"
line-height="27pt"  font-family="serif" space-after.optimum="18pt">
    <fo:wrapper font-style="italic">
		<xsl:value-of select="dedication" />
    </fo:wrapper>
    </fo:block>
  </xsl:template>

  <xsl:template match="chapter">
    <xsl:apply-templates select="chapter_info"/>
    <xsl:apply-templates select="quotes"/>
    <xsl:apply-templates select="section"/>
  </xsl:template>


<xsl:template match="chapter_info">
    <fo:block  font-size="24pt" line-height="21pt" font-family="serif">
    	g<xsl:value-of select="number"/><xsl:value-of
select="chapter_title" />
	</fo:block>
</xsl:template>


<xsl:template match="quotes">
    <fo:block  font-size="12pt" line-height="21pt" font-family="serif">
		<xsl:for-each select="quote/">
			<xsl:value-of select="quote_line" />
    <fo:wrapper font-weight="bold">
			<xsl:value-of select="from" />
    </fo:wrapper>
	</xsl:for-each>
 	</fo:block>
</xsl:template>

<xsl:template match="chapter">
	<fo:block font-size="12pt" line-height="15pt" font-family="serif" 
    space-after.optimum="12pt">
		    <xsl:apply-templates select="section_head"/>
		    <xsl:apply-templates select="para"/>
	</fo:block>
</xsl:template>


  <xsl:template match="section_head">
    <fo:wrapper font-weight="bold">
			<xsl:for-each select="line/">
				<xsl:value-of select="." />		
    		</xsl:for-each>
	</fo:wrapper>
  </xsl:template>

  <xsl:template match="para">
    <fo:block text-align-last="start" font-size="12pt" line-height="15pt"
space-after.optimum="12pt">
		<xsl:for-each select="./para/">
			<xsl:value-of select="." />		
   		</xsl:for-each>
    </fo:block>
  </xsl:template>

</xsl:stylesheet>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]