Jump to content

Fo:page-sequence/fo:block Error


scopley
 Share

Recommended Posts

I'm writing an xsl:fo stylesheet but for some reason as soon as I add an apply templates I get this error message "Expecting 'fo:page-sequence' but found 'fo:block' which is not a valid child of 'fo:root' ".Here is the code that seems to be the problem. As soon as I add the apply-templates under the fo:block I get the error

<xsl:template match="imm:foreword"><fo:page-sequence master-reference="master" initial-page-number="1" format="i"><fo:flow flow-name="body"><fo:block xsl:use-attribute-sets="headfoot" text-align="center" font-size="14pt" space-after="25pt" break-before="odd-page">FOREWORD</fo:block>  <xsl:apply-templates/></fo:flow></fo:page-sequence></xsl:template><xsl:template match="imm:title">	<fo:block xsl:use-attribute-sets="title space">		<xsl:apply-templates/>	</fo:block></xsl:template>

Here is a snippet of the xml document I'm formatting:

<para0 id="p1"><title>TITLE HERE</title></para0>

For the life of me I can't understand why applying a template with an fo:block would cause this error. Please HELP!!

Link to comment
Share on other sites

This is going to be a little long but here goes:

<xsl:template match="imm:imm">		<fo:root>			<fo:layout-master-set>				<fo:simple-page-master master-name="coverpg" margin-top="0.75in" margin-bottom="0.50in" margin-left="0.75in" margin-right="0.75in" page-height="11in" page-width="8.5in">					<fo:region-body region-name="cvr-body" margin-top="1.0in" margin-bottom="0.75in"/>					<fo:region-before region-name="header-cvr" extent="1.0in"/>					<fo:region-after region-name="footer-cvr" extent="1.0in"/>				</fo:simple-page-master>				<fo:simple-page-master master-name="PageMaster-odd" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.75in" margin-right="0.50in" page-height="11in" page-width="8.5in">					<fo:region-body region-name="body" margin-top="0.50in" margin-bottom="0.75in" column-count="2" column-gap="0.45in"/>					<fo:region-before region-name="header-odd" extent="0.50in"/>					<fo:region-after region-name="footer-odd" extent="0.50in"/>				</fo:simple-page-master>				<fo:simple-page-master master-name="PageMaster-even" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.50in" margin-right="0.75in" page-height="11in" page-width="8.5in">					<fo:region-body region-name="body" margin-top="0.50in" margin-bottom="0.75in" column-count="2" column-gap="0.45in"/>					<fo:region-before region-name="header-even" extent="0.50in"/>					<fo:region-after region-name="footer-even" extent="0.50in"/>				</fo:simple-page-master>				<fo:simple-page-master master-name="blank" margin-top="0.50in" margin-bottom="0.50in" margin-left="0.50in" margin-right="0.50in" page-height="11in" page-width="8.5in">					<fo:region-body region-name="blank-body" margin-top="0.50in" margin-bottom="0.75in"/>					<fo:region-before region-name="blank-before" extent="0.50in"/>					<fo:region-after region-name="blank-after" extent="0.50in"/>				</fo:simple-page-master>				<fo:page-sequence-master master-name="cover">					<fo:single-page-master-reference master-reference="coverpg"/>					<fo:single-page-master-reference master-reference="blank"/>				</fo:page-sequence-master>				<fo:page-sequence-master master-name="master">					<fo:repeatable-page-master-alternatives>						<fo:conditional-page-master-reference master-reference="blank" blank-or-not-blank="blank"/>						<fo:conditional-page-master-reference master-reference="PageMaster-odd" odd-or-even="odd"/>						<fo:conditional-page-master-reference master-reference="PageMaster-even" odd-or-even="even"/>					</fo:repeatable-page-master-alternatives>				</fo:page-sequence-master>			</fo:layout-master-set>			<xsl:apply-templates/>		</fo:root>	</xsl:template><!--**********************FOREWORD**********************-->	<xsl:template match="imm:foreword">		<fo:page-sequence master-reference="master" initial-page-number="1" format="i">			<!--FOREWORD HEADER ODD-->			<fo:static-content flow-name="header-odd">				<fo:block xsl:use-attribute-sets="headfoot" text-align="right">					<xsl:value-of select="$docname"/>				</fo:block>			</fo:static-content>			<!--FOREWORD HEADER - EVEN-->			<fo:static-content flow-name="header-even">				<fo:block xsl:use-attribute-sets="headfoot" text-align="left">					<xsl:value-of select="$docname"/>				</fo:block>			</fo:static-content>			<!--FOREWORD FOOTER - ODD-->			<fo:static-content flow-name="footer-odd">				<fo:block xsl:use-attribute-sets="headfoot" text-align="right">					<fo:page-number/>				</fo:block>			</fo:static-content>			<!--FOREWORD FOOTER - EVEN-->			<fo:static-content flow-name="footer-even">				<fo:block xsl:use-attribute-sets="headfoot" text-align="left">					<fo:page-number/>				</fo:block>			</fo:static-content>			<fo:flow flow-name="body">				<fo:block xsl:use-attribute-sets="headfoot" text-align="center" font-size="14pt" space-after="25pt" break-before="odd-page">FOREWORD				</fo:block>				<xsl:for-each select="imm:para0">					<xsl:apply-templates/>				</xsl:for-each>			</fo:flow>		</fo:page-sequence>	</xsl:template>	<!--TITLE-->	<xsl:template match="imm:title">		<fo:block xsl:use-attribute-sets="title space">			<xsl:apply-templates/>		</fo:block>	</xsl:template>

I really appreciate all your help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...