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

Re: inserting page-break after certain terms

Subject: Re: inserting page-break after certain terms
From: Andreas Peter <info@xxxxxxxxxx>
Date: Wed, 04 Jul 2007 16:35:52 +0200
Re:  inserting page-break after certain terms
Sorry, I thought my explanation was not detailed enough. So here are
parts of the code.

The XML source:

<section>
<h1>HomC6opathie und Original IS Aromamischungen fC<r Frauen</h1>
<p>Im Mittelpunkt dieses Seminars stehen homC6opathische
Arzneimittelbilder und Original IS
Aromamischungen fC<r die verschiedenen Lebenszyklen der Frau. Frau
Stadelmann baut auf
bereits erworbenes Grundlagenwissen auf und geht auf spezifische
BehandlungsmC6glichkeiten
insbesondere bei PrC$menstruellem Syndrom, Stimmungsschwankungen und in
der Wechselzeit ein.
Voraussetzung fC<r die Teilnahme ist der Besuch des Seminars B;Die
homC6opathische Haus- und
ReiseapothekeB+ oder homC6opathisches Grundlagenwissen.</p>
<course>
<tr>
<consultant><consultant_name>Seminar mit Ingeborg
Stadelmann</consultant_name></consultant>
</tr>
<tr>
<day>Do</day><date>11.01.07</date><time> 10.00 - 18.00
Uhr</time><course_nr>Kurs-Nr.: </course_nr><nr>5</nr><dues>70,00 B
</dues>
</tr>
</course>
</section>

<section>
<h1>Die homC6opathische Haus- und Reiseapotheke</h1>
<p>In diesem Seminar erhalten Sie eine umfassende EinfC<hrung in die
klassische HomC6opathie nach der Lehre Hahnemanns. Frau Stadelmann
erlC$utert die Begriffe Arzneimittelbild, ModalitC$t und Potenzwahl. Sie
erklC$rt Ihnen die Arzneiwirkung, die Dosierung sowie den Einsatz und
die Grenzen der HomC6opathie im Hausgebrauch. Es werden die
homC6opathischen Arzneimittelbilder besprochen, die Inhalt der Haus-
und Reiseapotheke sind.</p>
<course>
<tr>
<consultant>
<consultant_name>Seminar mit Ingeborg Stadelmann</consultant_name>
</consultant>
</tr>
<tr>
<day>Fr</day>
<date>12.01.07</date>
<time>14.00 - 18.00 Uhr</time>
<course_nr>Kurs-Nr.:</course_nr>
<nr>1</nr>
<dues>75 Euro</dues>
</tr>
<tr>
<day>Sa</day>
<date>13.01.07</date>
<time>10.00 - 16.00 Uhr</time>
<course_nr/>
<nr/>
<dues/>
</tr>
</course>
</section>

and so on...

The XSL code:

<xsl:template match="section">
<xsl:variable name="count_p" select="round(sum(p/string-length(.)) div
$max.char.line.p)" />
<xsl:variable name="count_h1" select="(count(h1))" />
<xsl:variable name="count_tr" select="(count(course/tr))" />
<xsl:variable name="count_li" select="(count(course/list/li))" />
<xsl:variable name="count_ad"
select="(count(course/tr/addition/additional_text))" />
<xsl:variable name="gesamt" select="((($count_p + ($count_p)-1)) +
($count_h1) + ($count_tr) + ($count_li) + ($count_ad)) * 8 * $ptmm"/>

<xsl:choose>
<xsl:when test="sum($gesamt) &lt; 180">
<fo:block break-after="page">
<xsl:apply-templates/>
</fo:block>
</xsl:when>
</xsl:choose>
</xsl:template>

This works so far, but a page-break is included after every <section>,
not after 180mm.

Thanks so much for helping me.
Andreas

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.