List Info

Thread: Page break before sect1 elements, but only in articles




Page break before sect1 elements, but only in articles
user name
2006-05-31 13:30:55
Dear List,

How can docbook be customized to add a page break before
section level1 
(sect1) elements, but only if the doctype is article?
Adding <xsl:attribute
name="break-before">page</xsl:attribute>
; to the 
section.level1.properties set causes page breaks in books as
well, which 
is not desirable.

I have not found a solution in the list archives, the thread
below 
addresses a similar problems, but unfortunately without a
good solution.

http://www.m
ail-archive.com/docbook-appslists.oasis-open.org/msg07842.html

Is it possible to solve this problem without having to use
different 
stylesheets for articles and books?


Any suggestions are welcome.

Regards,

Robert Fekete

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org

Page break before sect1 elements, but only in articles
user name
2006-05-31 17:49:50
Robert,

I'm not sure how to do this based on the doctype, but
here is a way to do it based on the root element, which
I think yields the same result.

In your customization layer, include the following:

  <xsl:variable name="sect1break">
    <xsl:choose>
      <xsl:when
test="/article">page</xsl:when>
      <xsl:otherwise>auto</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

  <xsl:attribute-set
name="section.level1.properties">
    <xsl:attribute
name="break-before"><xsl:value-of
select="$sect1break"/></xsl:attribute>
  </xsl:attribute-set>

The xsl:variable element sets the variable
"sect1break" to "page"
if the root element is article and assigns it to
"auto" otherwise
("auto" is a "no-op" value that
causes the property to be discarded).

Hope that helps.

Dick Hamilton

> -----Original Message-----
> From: Fekete Robert [mailto:frobertbalabit.com] 
> Sent: Wednesday, May 31, 2006 7:31 AM
> To: docbook-appslists.oasis-open.org
> Subject: [docbook-apps] Page break before sect1
elements, but 
> only in articles
> 
> 
> Dear List,
> 
> How can docbook be customized to add a page break
before 
> section level1 
> (sect1) elements, but only if the doctype is article?
> Adding <xsl:attribute
name="break-before">page</xsl:attribute>
; to the 
> section.level1.properties set causes page breaks in
books as 
> well, which 
> is not desirable.
> 
> I have not found a solution in the list archives, the
thread below 
> addresses a similar problems, but unfortunately without
a 
> good solution.
> 
http://www.m
ail-archive.com/docbook-appslists.oasis-open.org/msg07842.h
tml

Is it possible to solve this problem without having to use
different 
stylesheets for articles and books?


Any suggestions are welcome.

Regards,

Robert Fekete

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org




------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )