Pages: 1
Print
Author Topic: Use outputclass attribute to determine when to make a page break  (Read 3002 times)
mtbowers
Member

Posts: 9


« on: September 05, 2011, 07:42:11 AM »

Is this possible?

I would like to use the outputclass attribute to determine which topics should have a page break before them. I put this code in my commons-attr.xsl file:

Code:
<xsl:attribute-set name="pagebreak">
   <xsl:attribute name="break-before">page</xsl:attribute>
</xsl:attribute-set>

Then, I have this other piece of code that I'm trying to insert into the commons.xsl file:

Code:
<xsl:template match="//*[contains(@class,' topic/topic ')]/*[contains(@outputclass,'pagebreak')]">
   <fo:block xsl:use-attribute-sets="pagebreak">
   </fo:block>
</xsl:template>

The problem is, every topic now has a page break before it. What am I doing wrong? Am using XMetal 6.0. Thanks!
Logged
gcrews
Member

Posts: 265


« Reply #1 on: September 05, 2011, 10:27:18 AM »

You might check your source content (map and topic) for any stray “pageBreak” attributes.

Also it may be related to this issue:
http://forums.xmetal.com/index.php/topic,714.0.html
Did it do it before you added your code?

Also, what element are you marking as outputclass=”pagebreak“? Are you using a meta data element or something? The /* in the middle of your xpath will match any element anywhere in a topic that is set to pagebreak. Wouldn’t you only watch to match and use the topic element?
Logged
Pages: 1
Print
Jump to: