snehamayi senapati
snehamayi senapati

Reputation: 95

How to create a page-break between two XSL templates

I am trying to use page-break or any space between two templates.

<xsl:template match="content_name">
   <fo:block space-after="7pt" space-after.conditionality="retain" line- 
 height="1.147" font-family="Calibri" font-size="15pt" font-weight="bold" language="FR">
   </fo:block>
</xsl:template>

<!--Here i want to add a page break-->

<xsl:template match="pro_list">
  <fo:block space-after="15pt" space-after.conditionality="retain" line-height="1.147" font-family="Calibri" font-size="15pt" font-weight="bold" text-decoration="underline" language="FR">
  </fo:block>
</xsl:template>

Could you please tell me how to achieve this?
I have tried many options, but none of them is working...

Upvotes: 1

Views: 99

Answers (1)

zx485
zx485

Reputation: 29052

You cannot do this.
Your question is the result of a fundamental misunderstanding of how XSLT does work. Each xsl:template matches one specified form of XML. Trying to add a match between two templates is futile. So every page-break functionality has to be in a template and not between two templates.

Therefore you can add a page-break here

<xsl:template match="content_name">
   <fo:block space-after="7pt" space-after.conditionality="retain" line- 
 height="1.147" font-family="Calibri" font-size="15pt" font-weight="bold" language="FR">
   <!-- Add a page break here -->
   </fo:block>
</xsl:template>

or there

<xsl:template match="pro_list">
  <fo:block space-after="15pt" space-after.conditionality="retain" line-height="1.147" font-family="Calibri" font-size="15pt" font-weight="bold" text-decoration="underline" language="FR">
  </fo:block>
  <!-- Add a page break here -->
</xsl:template>

or in any other location in those two templates. But not between those templates!

Upvotes: 1

Related Questions