Re: [docbook-apps] Section Orientation

From
Bob Stayton <>
Date
2004-03-10T18:00:11+00:00
ID
056501c406cb$7976c0d0$6501a8c0@toshiro
Thread
Re: [docbook-apps] Section Orientation
First, your new template is not working 
because you aren't understanding how XSL templates and parameters 
work.  You can't reset a global parameter from within a 
template.  The effect of your template is as follows:

 

1. When a sect1 with attribute @orient='l' 
is encountered, set a local parameter named 'page.orientation'.

 

2. When the template is finished, the 
parameter goes out of scope, and no further processing is done on the 
sect1.

 

You have overridden the default processing 
for sect1 when that attribute is set, so that is why the section 
disappears.  In general, when you want to extend the processing done for a 
match, you would use xsl:apply-imports to apply the standard DocBook templates 
to the sect1.  But the parameter setting will have no effect, because 
the page orientation is set when a page 
sequence in FO is started, but a sect1 does not start a page 
sequence.

 

Unfortunately, switching orientation in the 
middle of a page sequence is not a standard feature in XSL-FO.  It can be 
done, but, you will need to apply Ken Holman's brilliant Page Sequence Master 
Interleave (PSMI) solution:

 

http://www.cranesoftwrights.com/resources/psmi/

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

  
----- Original Message ----- 

  
From: 
  Russell Seymour 

  
To: Russell Seymour ;  
  

  
Sent: Wednesday, March 10, 2004 8:02 
  AM

  
Subject: Re: [docbook-apps] Section 
  Orientation

  

  
Hi,

  
 

  
As a follow up to the email this morning, I think 
  I am a bit closer to getting this working, but I am failing at the last 
  hurdle.

  
 

  
I have added an attribute to the <sect1> 
  tag in my XML that says orient='l' or 'p'.  I then have a custom XSL in 
  my FO directory that has:

  
 

  
<xsl:template match="sect1[@orient = 
  'l']">

  
    <xsl:param 
  name="page.orientation" select="landscape"/>

  
</xsl:template>

  
 

  
However whilst this template match is being 
  picked up, this section is not displayed on the final PDF.  The document 
  only has the title page and TOC.

  
 

  
Can anyone give me any pointers for this one 
  please?

  
 

  
Thanks, Russell

  
    
----- Original Message ----- 

    
From: 
    Russell Seymour 

    
To:  
    

    
Sent: Wednesday, March 10, 2004 11:36 
    AM

    
Subject: [docbook-apps] Section 
    Orientation

    

    
Good morning list,

    
 

    
Although I know how to set the orientation for the whole document which 
    is rendered from a DocBook, I wondered if there was a way to specify there 
    orientation that is required in a section.

    
 

    
I have a system that produces reports from a variety of data sources 
    and some of that data would be better displayed on a landscape orientation 
    whereas the rest of the document would be best in portrait.

    

Does anyone now of a way of doing this?

    

Thanks in advance.

    

Russell