xsl-list
[Top] [All Lists]

List-block choose trouble with duplicates

2004-01-14 09:14:30
My scenario is this
If there is a title in step2 number it like:
2.1     This is my title

        This is my paragraph
        
If there is no title, number the paragraph like:

2.1     This is my paragraph

If there is a warning|caution|note before paragraph still number the
paragraph like:
        Warning
        Caution
        Note
2.1     This is my paragraph.

My test for title works fine but then I'm confused.
In my test for warning|caution|note if I apply-templates at the end I
get:

        Warning
        Caution
        Note
2.1     This is my paragraph.
        Warning
        Caution
        Note
        This is my paragraph. 

Here's what I have right now, but there must be a better way to do this:

<xsl:template match="step2">
<xsl:choose>
<xsl:when test="title">
<fo:list-block provisional-distance-between-starts="2cm"
provisional-label-separation="1em">
  <fo:list-item space-after="4mm">
   <fo:list-item-label end-indent="label-end()">
     <fo:block id="{(_at_)id}" font-size="12pt" font-weight="bold">
        <xsl:number count="step1|step2" from="mainfunc|closeup"
level="multiple" format="1.1.1.1 "/>
     </fo:block> 
   </fo:list-item-label>
   <fo:list-item-body start-indent="2cm">
     <fo:block font-size="12pt" font-weight="bold" space-after="5mm"
keep-with-next.within-page="always">
    <xsl:value-of select="title"/>
    </fo:block>
   </fo:list-item-body>
  </fo:list-item>
</fo:list-block>
<xsl:apply-templates/>
</xsl:when>
<xsl:when test="warning|caution|note">
<xsl:apply-templates select="warning|caution|note"/>
<fo:list-block provisional-distance-between-starts="2cm"
provisional-label-separation="1em">
  <fo:list-item space-after="4mm">
   <fo:list-item-label end-indent="label-end()">
     <fo:block id="{(_at_)id}" font-size="12pt" font-weight="bold" >
        <xsl:number count="step1|step2" from="mainfunc|closeup"
level="multiple" format="1.1.1.1 "/>
     </fo:block> 
   </fo:list-item-label>
   <fo:list-item-body start-indent="0cm">
     <fo:block margin-left="2cm">
    <xsl:value-of select="para"/>
    </fo:block>
   </fo:list-item-body>
  </fo:list-item>
</fo:list-block>
<xsl:apply-templates/> 
</xsl:when>
</xsl:choose>
</xsl:template>

Here is sample of xml

<step2 id="step2-1">
<caution>
<para>Batteries weigh 75lbs. (34 Kg) each. Do not lift or move batteries
without
the aid of an assistant. Caution in a step 2.</para>
</caution>
<note>
<para>This is a note check out the format in a step 2. This is a step2
note
to check formatting. This is a step2 note to check formatting.</para>
</note>
<para>Install terminal on negative post of battery 2 with screw and nut.
Tighten
nut to 8 lb-ft. (9-11&#xa0;N.m).  This is a step 2.</para>
<step3 id="step3-1">
<note>
<para>This is a step3 note to check formatting.</para>
</note>
<para>Install terminal on negative post of battery 2 with screw and nut.
Tighten
nut to 8 lb-ft. (9-11&#xa0;N.m).  This is a step 3.</para>
</step3>




Confidentiality Notice
The information contained in this e-mail is confidential and intended for use 
only by the person(s) or organization listed in the address. If you have 
received this communication in error, please contact the sender at O'Neil & 
Associates, Inc., immediately. Any copying, dissemination, or distribution of 
this communication, other than by the intended recipient, is strictly 
prohibited.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>