[xsl] Re:Re: [xsl] xsl-fo: fo:floats stay with prev element and next

Subject: [xsl] Re:Re: [xsl] xsl-fo: fo:floats stay with prev element and next
From: Bryon Thomas <bthomas30@xxxxxxxxx>
Date: Mon, 30 Sep 2013 14:07:16 -0400
Thanks Ken, that worked well. Although now I'm quandary.
i have <images> inside <p> tags which together are keyrefs to a main map.
In a topic, I have a the keyref placed inside an <ol><li><p>.

The images float right, which is great.
when structure is:
<xsl:when test="@outputclass= 'noboxright' "
1 <fo:block>
2 <fo:float float=end intrusion-displace=block>
3 <xsl:call=template name="commonattributes"/>
4 <fo:block>
5 <xsl:apply templates select="." mode="placeImage">....

The <ol> is placed right after a nearly page size <image
placement=break> image. When printed, the 1st <li><p> will appear at
the bottom of the page, and push the float image to the second <li>,
the second image to the third <li> etc.
 I want the <li> with <p> keyrefs to stay together. If I place keep
attributes in fo:block (4), the keeps won't change the problem.
If I put keeps on fo:block (1), it ignores the float=end rule on 2.

Does this make sense?
Thanks
Bryon T.



On Fri, Sep 27, 2013 at 1:10 AM,
<xsl-list-digest-help@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> xsl-list Digest 27 Sep 2013 05:10:00 -0000 Issue 3202
>
> Topics (messages 64767 through 64769):
>
> xsl-fo: fo:floats stay with prev element and next element starts after float
>         64767 by: Bryon Thomas
>         64768 by: G. Ken Holman
>
> List grouping
>         64769 by: Joga Singh Rawat
>
> Administrivia:
>
> To subscribe to the digest, e-mail:
>         <xsl-list-digest-subscribe@xxxxxxxxxxxxxxxxxxxxxx>
>
> To unsubscribe from the digest, e-mail:
>         <xsl-list-digest-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
>
> To post to the list, e-mail:
>         <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>
>
> ----------------------------------------------------------------------
> Date: Thu, 26 Sep 2013 16:53:54 -0400
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> From: Bryon Thomas <bthomas30@xxxxxxxxx>
> Subject: xsl-fo: fo:floats stay with prev element and next element starts
>  after float
> Message-ID: <CANQwMAHSyCfXJf5GCcDpnd=EkaHFwpz4UUdMG0ptFZnez7QYAw@xxxxxxxxxxxxxx>
>
> Hopefully Ill explain this clearly.
>
> Using Oxygen 15 with DITA-OT 1.7, Antenna House 6, xsl-fo
> xsl version 2.0. Non specialized DITA
>
> I have many pages with instructions on left, and image on right. I
> have placed the image inside the xml element I want it to be connected
> to.
> Every time  i have a new instruction with the image on the right, I
> want the image top to start with the first line of text in the
> element.
> When I have multiple instructions and floats, I want the next float
> to do the same as the first float, but start below the 1st image
> float.
>
> Right now, when I have multiple floats, the floats will all (mostly
> starting from parent titles), group on the right under each other
> starting at the top of the page. The xml elements on the left will all
> bunch together on the top left (Meaning the text on the left is at the
> top, and the images on right are from top to bottom.
> Snippet of current code:Any help would be greatly appreciated, I can't
> figure out the floats quickly enough.
>
> <xsl:choose>
>             <xsl:when test="not(@placement = 'inline')">
>                 <!--                <fo:float
> xsl:use-attribute-sets="image__float">-->
>                 <fo:block xsl:use-attribute-sets="image__block">
>                     <xsl:call-template name="commonattributes"/>
>                     <xsl:apply-templates select="." mode="placeImage">
>                         <xsl:with-param name="imageAlign" select="@align"/>
>                         <xsl:with-param name="href" select="if (@scope
> = 'external') then @href else concat($input.dir.url, @href)"/>
>                         <xsl:with-param name="height" select="@height"/>
>                         <xsl:with-param name="width" select="@width"/>
>                     </xsl:apply-templates>
>                 </fo:block>
>                 <!--                </fo:float>-->
>             </xsl:when>
>             <xsl:when test="@outputclass= 'right'">
>                 <fo:float float="right" clear="end">
>                     <xsl:call-template  name="commonattributes"/>
>                     <fo:block xsl:use-attribute-sets="floatright">
>                         <xsl:apply-templates select="."
> mode="placeImage">
>                             <xsl:with-param name="imageAlign" select="@align"/>
>                             <xsl:with-param name="href" select="if
> (@scope = 'external') then @href else concat($input.dir.url, @href)"/>
>                             <xsl:with-param name="height" select="@height"/>
>                             <xsl:with-param name="width" select="@width"/>
>                         </xsl:apply-templates>
>                     </fo:block>
>                 </fo:float>
>
>     <xsl:attribute-set name="floatright">
>         <xsl:attribute name="border-style">solid</xsl:attribute>
>         <xsl:attribute name="border-color">black</xsl:attribute>
>         <xsl:attribute name="border-width">1pt</xsl:attribute>
>         <xsl:attribute name="keep-with-previous">always</xsl:attribute>
>         <xsl:attribute name="space-after">5mm</xsl:attribute>
>     </xsl:attribute-set>
>     <xsl:attribute-set name="noboxright">
>         <xsl:attribute name="keep-with-previous">always</xsl:attribute>
>         <xsl:attribute name="space-after">5mm</xsl:attribute>
>     </xsl:attribute-set>
>
> xml code:
> <body><ul><li><p> when performing operations, do x. <image href=....
> outputclass="right" id=....:>
>
> ------------------------------
>
> Date: Thu, 26 Sep 2013 17:11:24 -0400
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx,xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
> Subject: Re: [xsl] xsl-fo: fo:floats stay with prev element and next
>   element starts after float
> Message-Id: <7.0.1.0.2.20130926170835.0230bf58@xxxxxxxxxxxxxxxxxxxxxx>
>
> At 2013-09-26 16:53 -0400, Bryon Thomas wrote:
>>Right now, when I have multiple floats, the floats will all (mostly
>>starting from parent titles), group on the right under each other
>>starting at the top of the page. The xml elements on the left will all
>>bunch together on the top left (Meaning the text on the left is at the
>>top, and the images on right are from top to bottom.
>>Snippet of current code:Any help would be greatly appreciated, I can't
>>figure out the floats quickly enough.
>
> You need two things:
>
>   - the float has to be specified inside the block with the text
>
>   - the block needs clear="end" in order to flow after the previous last float
>
> This end result is what I mocked up and works in Antenna House:
>
>      <flow flow-name="frame-body" font-size="40pt" clear="end">
>
>        <block clear="end">
>          <float float="end" intrusion-displace="block">
>            <block background-color="silver">F111</block>
>            <block background-color="silver">F111</block>
>            <block background-color="silver">F111</block>
>          </float> B222 B222 </block>
>
>        <block clear="end">
>          <float float="end" intrusion-displace="block" clear="end">
>            <block background-color="silver">F111</block>
>            <block background-color="silver">F111</block>
>            <block background-color="silver">F111</block>
>          </float> B222 B222 B222 </block>
>
>      </flow>
>
> I hope this helps.
>
> . . . . . . . . . . . Ken
>
> --
> Public XSLT, XSL-FO, UBL & code list classes: Melbourne, AU May 2014 |
> Contact us for world-wide XML consulting and instructor-led training |
> Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
> Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/ |
> G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx |
> Google+ profile: https://plus.google.com/116832879756988317389/about |
> Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |
>
> ------------------------------
>
> Date: Fri, 27 Sep 2013 10:41:16 +0530
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> From: "Joga Singh Rawat" <jrawat@xxxxxxxxxxxxxx>
> Subject: List grouping
> Message-ID: <003901cebb3f$ff087080$fd195180$@aptaracorp.com>
>
> Dear List,
>
> Anyone who can provide the idea to handle below list in worldml
>
> <w:p><w:pPr><w:listPr><w:ilvl w:val="0"/><wx:t
> wx:val="1."/></w:listPr></w:pPr><w:r><w:t>First level</w:t></w:r></w:p>
> <w:p><w:pPr><w:listPr><w:ilvl w:val="1"/><wx:t
> wx:val="a."/></w:listPr></w:pPr><w:r><w:t>Second
> level</w:t></w:t></w:r></w:p>
> <w:p><w:pPr><w:listPr><w:ilvl w:val="0"/><wx:t
> wx:val="2."/></w:listPr></w:pPr><w:r><w:t>First level</w:t></w:r></w:p>
> <w:p><w:pPr><w:listPr><w:ilvl w:val="0"/><wx:t
> wx:val="3."/></w:listPr></w:pPr><w:r><w:t>First lvel</w:t></w:r></w:p>
>
> Should be
>
> <list>
> <li><num>1.</num><p>First level<p>
> <list>
> <li><num>a.</num><p>Second level<p></li>
> </list></li>
> <li><num>2.</num><p>First level<p></li>
> <li><num>3.</num><p>First level<p></li>
> </list>
>
> Thanks
> .JSR
>
> ------------------------------
>
> End of xsl-list Digest
> ***********************************

Current Thread