Next in thread → Next in month →

Re: [docbook-apps] Section Orientation

From
Russell Seymour <>
Date
2004-03-12T09:13:09+00:00
ID
000d01c40814$23884dc0$4785900a@fozzybear
Thread
Re: [docbook-apps] Section Orientation
Bob,

Thanks very much for this pointer, it has helped me enormously.  
However there is one small issue, that I believe someone else on this list had, 
but I was not able to find the solution.

 

I have successfully got the PSMI tags into my XML document, and I run it 
through the appropriate XSLT files. However when I get to processing the 
document with FOP I get a warning saying that the 'reference-orientaion' is not 
yet implemented.  I believe this is the last stumbling block before I get 
the document looking how I want it.

 

I did find on the of the users on this list had managed to work around the 
problem and had attached their XSLT that sorted this problem out, however this 
attachement does not seem to be avaliable.

 

If anyone knows how to get around this problem then please can you let me 
know.

Thanks very much,

Russell

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

  
From: 
  Bob Stayton 
  

  
To: Russell Seymour ;  
  

  
Sent: Wednesday, March 10, 2004 6:14 
  PM

  
Subject: 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
Next in thread → Next in month →