[xep-support] Using RenderX Flow Sections Extensions

From: Jacqueline Radebaugh <jrad@loc.gov>
Date: Wed Dec 20 2006 - 06:43:57 PST

Dear All:

I am trying to create a two column table in XSL:FO from which data will flow from column to column onto 10 consecutive pages.

A portion of the XML is:

<characterPositions>
         <characterPosition type="full concise">
            <label>18-19</label>
            <name>Form of composition</name>
            <level>standard</level>
            <value type="concise">
               <label>an</label>
               <name>Anthems</name>
               <level>standard</level>
            </value>
            <value type="concise">
               <label>bd</label>
               <name>Ballads</name>
               <level>standard</level>
            </value>
<!-- There are many, many, many more <value> elements within this <characterPosition> element ->
    </characterPosition>
</characterPositions>

My XSL-FO code for the table is:

 <xsl:template match="characterPositions" mode="header">
  <fo:block space-before="2em">
   <fo:table table-layout="fixed" width="100%">
    <fo:table-column column-width="100em"/>
    <fo:table-body>
     <fo:table-row>
      <fo:table-cell>
       <fo:block font-weight="bold">
        <xsl:text>Character Positions (008/18-34 and 006/01-17)</xsl:text>
       </fo:block>
      </fo:table-cell>
     </fo:table-row>
    </fo:table-body>
   </fo:table>
   <xsl:variable name="characterPositionCount" select="count(characterPosition) div 2+1"/>
   <fo:table table-layout="fixed" width="100%">
    <fo:table-column column-width="27em"/>
    <fo:table-column column-width="60em"/>
    <fo:table-body>
     <fo:table-row>
      <fo:table-cell>
       <fo:block>
        <fo:table table-layout="fixed" width="40%">
         <fo:table-column column-width="5em"/>
         <fo:table-column column-width="15em"/>
         <fo:table-column column-width="15em"/>
         <fo:table-column column-width="5em"/>
         <fo:table-body>
          <xsl:for-each select="characterPosition[position()&lt;$characterPositionCount]">
           <fo:table-row>
            <fo:table-cell>
               <fo:block text-align="left" margin-left="1em">
                <xsl:value-of select="label"/>
               </fo:block>
            </fo:table-cell>
            <fo:table-cell>
               <fo:block text-align="left">
                <xsl:value-of select="name"/>
               </fo:block>
            </fo:table-cell>
           </fo:table-row>
           <fo:table-row>
            <fo:table-cell>
             <xsl:for-each select="value">
              <fo:block margin-left="3em">
               <xsl:value-of select="label"/>
              </fo:block>
             </xsl:for-each>
            </fo:table-cell>
            <fo:table-cell>
             <xsl:for-each select="value">
              <fo:block>
               <xsl:value-of select="name"/>
              </fo:block>
             </xsl:for-each>
            </fo:table-cell>
           </fo:table-row>
          </xsl:for-each>
         </fo:table-body>
        </fo:table>
       </fo:block>
      </fo:table-cell>
      <fo:table-cell>
       <fo:block>
        <fo:table table-layout="fixed" width="40%">
         <fo:table-column column-width="5em"/>
         <fo:table-column column-width="15em"/>
         <fo:table-column column-width="15em"/>
         <fo:table-column column-width="5em"/>
         <fo:table-body>
          <xsl:for-each select="characterPosition[position()&gt;$characterPositionCount]">
           <fo:table-row>
            <fo:table-cell>
               <fo:block text-align="left" margin-left="1em">
                <xsl:value-of select="label"/>
               </fo:block>
            </fo:table-cell>
            <fo:table-cell>
               <fo:block text-align="left">
                <xsl:value-of select="name"/>
               </fo:block>
            </fo:table-cell>
           </fo:table-row>
           <fo:table-row>
            <fo:table-cell>
             <xsl:for-each select="value">
              <fo:block margin-left="3em">
               <xsl:value-of select="label"/>
              </fo:block>
             </xsl:for-each>
            </fo:table-cell>
            <fo:table-cell>
             <xsl:for-each select="value">
              <fo:block>
               <xsl:value-of select="name"/>
              </fo:block>
             </xsl:for-each>
            </fo:table-cell>
           </fo:table-row>
          </xsl:for-each>
         </fo:table-body>
        </fo:table>
       </fo:block>
      </fo:table-cell>
     </fo:table-row>
    </fo:table-body>
   </fo:table>
   </fo:block>
  <fo:block>
   <fo:leader leader-length="100%" leader-pattern="rule" rule-style="solid" rule-thickness=".1mm" color="black"/>
  </fo:block>
  </xsl:template>

As you can see, I am using:

<xsl:variable name="characterPositionCount" select="count(characterPosition) div 2+1"/>

to divide the data into two columns on the page. However, because of the great length of data within each <characterPosition> element (this is because of the amount of <value> elements below <characterPosition>), the list of <characterPosition><value> elements in the first column continues onto the next page, instead of streaming onto the second column first.

Ideally, I would like the data to stream from one column to the next before breaking onto a new page (like "newspaper columns").

Someone kindly told me about the RenderX Flow Section extension. I have tried to implement the extension into my code, however, XEP seems to be ignoring it. The code that includes the extensions is:

<xsl:template match="/">
  
  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
   xmlns:rx="http://www.renderx.com/XSL/Extensions">
  
   <fo:layout-master-set>
    
         <fo:simple-page-master
          master-name="even_page"
          page-height="11in"
          margin-right="1in"
          margin-top=".5in"
          margin-left="1in"
          margin-bottom=".5in"
          page-width="8.5in">
               <fo:region-before
                extent="8.5in"
                region-name="even_before"/>
               <fo:region-body
                margin-top=".3in"
                margin-bottom=".3in"/>
               <fo:region-after
                extent=".2in"
                precedence="true"
                region-name="even_after"/>
         </fo:simple-page-master>
    
         <fo:simple-page-master
          master-name="odd_page"
          page-height="11in"
          margin-right="1in"
          margin-top=".5in"
          margin-left="1in"
          margin-bottom=".5in"
          page-width="8.5in">
               <fo:region-before
                extent="8.5in"
                region-name="odd_before"/>
               <fo:region-body
                margin-top=".3in"
                margin-bottom=".3in"/>
               <fo:region-after
                extent=".2in"
                precedence="true"
                region-name="odd_after"/>
         </fo:simple-page-master>
    
        <fo:simple-page-master
             master-name="TwoColumns">
         <fo:region-body
          column-count="2"
          column-gap="0.2in"
          border-top="thin solid silver"
          border-bottom="thin solid silver"
          margin="0.9in 0.4in"/>
         <fo:region-before
          extent="0.8in"
          display-align="after"
          padding="0in 0.4in 3pt"/>
         <fo:region-after
          extent="0.8in"
          display-align="before"
          padding="0.1in 0.4in 0in"/>
        </fo:simple-page-master>
    
    <fo:page-sequence-master master-name="Repeat-TwoColumns">
          <fo:repeatable-page-master-reference master-reference="TwoColumns"/>
    </fo:page-sequence-master>
    
    <fo:page-sequence-master master-name="Page">
          <fo:repeatable-page-master-alternatives>
           <fo:conditional-page-master-reference
            master-reference="odd_page"
            odd-or-even="odd"
            page-position="any"/>
          <fo:conditional-page-master-reference
           master-reference="even_page"
           odd-or-even="even"
           page-position="any"/>
        </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>
   </fo:layout-master-set>
   
   <fo:page-sequence
    master-reference="Page"
    force-page-count="even"
    initial-page-number="1">
    
            <fo:static-content
             flow-name="odd_before">
            <fo:block
             text-align="right"
             font-weight="bold"
             font-size="14pt">041</fo:block>
            </fo:static-content>
    
             <fo:static-content
              flow-name="odd_after">
            <fo:block>
                 <fo:inline
                  text-align-last="justify"
                  font-style="italic"
                  font-size="10pt">MARC 21 - Bibliographic
                 <fo:leader
                  leader-pattern="space"
                  leader-length="25%"/>October 2001
                 <fo:leader
                  leader-pattern="space"
                  leader-length="25%"/>041 - p.<fo:page-number/>
                 </fo:inline>
           </fo:block>
             </fo:static-content>
    
    <fo:static-content
     flow-name="even_before">
           <fo:block
            text-align="left"
            font-weight="bold"
            font-size="14pt">041</fo:block>
    </fo:static-content>
    
    <fo:static-content
     flow-name="even_after">
            <fo:block>
             <fo:inline
              text-align-last="justify"
              font-style="italic"
              font-size="10pt">041 - p.<fo:page-number/>
             <fo:leader
              leader-pattern="space"
              leader-length="25%"/>October 2001
            <fo:leader
             leader-pattern="space"
             leader-length="25%"/>MARC 21 - Bibliographic</fo:inline>
           </fo:block>
    </fo:static-content>
 
    <fo:flow
     flow-name="xsl-region-body">
          <fo:block
           font-size="10pt">
                   <xsl:apply-templates/>
           </fo:block>
    </fo:flow>
    
   </fo:page-sequence>
   
   <fo:page-sequence
    master-reference="Repeat-TwoColumns">
    <fo:flow flow-name="xsl-region-body">
     <rx:flow-section column-count="2" column-gap="8pt">
      <fo:block>
       <xsl:apply-templates select="guidelines/characterPositions" mode="header"/>
      </fo:block>
     </rx:flow-section>
    </fo:flow>
   </fo:page-sequence>
      
  </fo:root>
 </xsl:template>

Do any of you have any idea what I am doing incorrectly? Is there a reason why XEP is ignoring the extensions?

Thank you so very much for all of your help! I sincerely appreciate it!

Best wishes,

Jackie Radebaugh

Library of Congress
Network Development & MARC Standards Office
Washington, DC
USA
Phone: +1-202-707-1153
FAX: +1-202-707-0115
E-Mail: jrad@loc.gov

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Wed Dec 20 06:56:01 2006

This archive was generated by hypermail 2.1.8 : Wed Dec 20 2006 - 06:56:05 PST