[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problems with FO

Subject: Problems with FO
From: Carlos Araya <elrond@xxxxxxxxxxxxxxxx>
Date: Wed, 31 May 2000 18:53:39 -0700 (PDT)
fo select
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.