[xep-support] Using RenderX Flow Sections Extensions

Dan Ochs dan.ochs at gmail.com
Thu Dec 21 08:51:57 PST 2006


can you please attach a sample working XML document and your entire
xsl-fo stylesheet?  Something we can test?  Also, what versio nof XEP
are you using?

thanks, dan

On 12/21/06, Jacqueline Radebaugh <jrad at loc.gov> wrote:
> Dear All:
>
> Thank you, Dan, for your suggestion.  However, unfortunately when I removed the extensions and created the following page-sequence master and page-sequence:
>
> <fo:page-sequence-master master-name="Repeat-TwoColumns">
>    <fo:repeatable-page-master-alternatives>
>     <fo:conditional-page-master-reference
>      master-reference="TwoColumns"
>      odd-or-even="odd"
>      page-position="any"/>
>    </fo:repeatable-page-master-alternatives>
>     </fo:page-sequence-master>
>
>   <fo:page-sequence
>     master-reference="Repeat-TwoColumns">
>     <fo:flow flow-name="xsl-region-body">
>       <fo:block>
>        <xsl:apply-templates select="guidelines/characterPositions" mode="header"/>
>       </fo:block>
>     </fo:flow>
>    </fo:page-sequence>
>
> My data still does not align into two columns.
>
> A sample of my XML is:
>
>  <characterPositions>
>          <characterPosition type="full concise">
>             <label>18-19</label>
>             <name>Form of composition</name>
>             <alt>
>                <field>006</field>
>                <label>01-02</label>
>             </alt>
>             <level>standard</level>
>                <description type="full concise" change="yes">
>                   <p>Two-character alphabetic code that indicates the form of composition. </p>
>                </description>
>             <value>
>                <label>an</label>
>                <name>Anthems</name>
>                <level>standard</level>
>             </value>
>             <value>
>                <label>bd</label>
>                <name>Ballads</name>
>                <level>standard</level>
>             </value>
>             <value>
>                <label>bg</label>
>                <name>Bluegrass music</name>
>                <level>standard</level>
>             </value>
>        </characterPosition>
> </characterPositions>
>
> Like I said in my last message,  I want to create two columns of this data on each page flowing from left to right and then flowing onto the next page from left to right, etc.
>
> The XSLT code that I use for the characterPositions 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">
>            <fo:table-row>
>             <fo:table-cell>
>              <xsl:choose>
>               <xsl:when test="@change='yes'">
>                <fo:block text-align="left" margin-left="1em" border-start-color="black"
>                 border-start-style="outset" border-start-width=".01em" padding="1pt">
>                 <xsl:value-of select="label"/>
>                </fo:block>
>               </xsl:when>
>               <xsl:otherwise>
>                <fo:block text-align="left" margin-left="1em">
>                 <xsl:value-of select="label"/>
>                </fo:block>
>               </xsl:otherwise>
>              </xsl:choose>
>             </fo:table-cell>
>             <fo:table-cell>
>              <xsl:choose>
>               <xsl:when test="@change='yes'">
>                <fo:block text-align="left" border-start-width=".01em" padding="1pt">
>                 <xsl:value-of select="name"/>
>                </fo:block>
>               </xsl:when>
>               <xsl:otherwise>
>                <fo:block text-align="left">
>                 <xsl:value-of select="name"/>
>                </fo:block>
>               </xsl:otherwise>
>              </xsl:choose>
>             </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>
>
> Does anyone know what I am doing incorrectly?  Why is my data flowing into only one column (not two, like I specified)?
>
> Thank you very much for all of your help!
>
> 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 at loc.gov
>
>
> >>> dan.ochs at gmail.com 12/20/06 10:43 AM >>>
> Hi Jacqueline, we could probably help you even more if you attach a
> sample of the actual source xml as well.  But looking at your code, I
> think you can just use the TwoColumn page sequence master for you
> table without the rx:flow-section like the following and the output
> should then flow in two columns.
>
> <fo:page-sequence master-reference="Repeat-TwoColumns">
> <fo:flow flow-name="xsl-region-body">
> <fo:block>
> <xsl:apply-templates select="guidelines/characterPositions" mode="header"/>
> </fo:block>
> </fo:flow>
> </fo:page-sequence>
>
>
> dan
>
> On 12/20/06, Jacqueline Radebaugh <jrad at loc.gov> wrote:
> > 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 at loc.gov
> >
> >
> > -------------------
> > (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
> > in the body of the message to majordomo at 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
> >
> -------------------
> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
> in the body of the message to majordomo at 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
>
> -------------------
> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
> in the body of the message to majordomo at 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
>
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at 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



More information about the Xep-support mailing list