OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] ordered list numbering problem in html


You might consider using a <dl> instead.  You could put the generated number
in the <dt> and the listitem content into <dd>.  Hopefully you could use CSS
to adjust the relative indents to accomodate the widths of the numbers.

Regarding the numbers themselves, you might take a look at how the fo
stylesheet handles multiple level numbers. The DocBook DTD provides the
attribute inheritnum="inherit" on orderedlist to enable multilevel
numbering.  It is implemented in the FO side, where all the numbers are
generated.  See this template in fo/lists.xsl:

<xsl:template match="orderedlist/listitem" mode="item-number">

and look for "inheritnum".

On the HTML side, the native HTML numbering was used, and as you found, it
doesn't support this feature.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Jason Black" <jblack@limacorp.com>
To: <docbook-apps@lists.oasis-open.org>; "- LC DEV -"
<lc-dev@lists.limacorp.com>
Sent: Friday, August 19, 2005 8:16 AM
Subject: [docbook-apps] ordered list numbering problem in html


> Hi all,
>
> I have another dilemna that is causing me a headache.  I am trying to
> find a way to add multiple level numbering to the orderedlist element
> for html.  At first, I started looking down the path of simply doing
> this in css.  This process can be done with css2 using counter-reset and
> counter-increment, but since this is only supported in the  Opera
> browser, I can't use it.  It has to work in IE and Netscape. :(
>
> Next thing I started looking at was finding a way to program the
> functionality in XSLT.   I started down this path going pretty well by
> using <xsl:number>
>
>
> Here's what I did,  in the orderedlist template I changed the <ol> and
> </ol>  to <ul> and </ul> so I could keep the indentation, but lose the
> standard html numbering.  Then I changed orderedlist/listitem template
> as follows:
>
> <xsl:template match="orderedlist/listitem">
> <!-- My Change Here - comment out <li>
>  *****************
>   <li>
> -->
>     <xsl:if test="@override">
>       <xsl:attribute name="value">
>         <xsl:value-of select="@override"/>
>       </xsl:attribute>
>     </xsl:if>
>
>     <!-- we can't just drop the anchor in since some browsers (Opera)
>          get confused about line breaks if we do. So if the first child
>          is a para, assume the para will put in the anchor. Otherwise,
>          put the anchor in anyway. -->
>     <xsl:if test="local-name(child::*[1]) != 'para'">
>       <xsl:call-template name="anchor"/>
>     </xsl:if>
>
>     <xsl:choose>
>       <xsl:when test="$show.revisionflag != 0 and @revisionflag">
>         <div class="{@revisionflag}">
>           <xsl:apply-templates/>
>         </div>
>       </xsl:when>
>       <xsl:otherwise>
>
> <!-- My Change Here - add number counter on orderedlist listitem
>   *****************
>  -->
>          <xsl:variable name="blah">
>           <xsl:number count='listitem' level='multiple' format='1.1'/>
>           </xsl:variable>
>          <xsl:value-of select="$blah"/>
>
> <!-- **************
>       MyChange End
> -->
>
>
>          <xsl:apply-templates/>
>       </xsl:otherwise>
>     </xsl:choose>
>
> <!-- My Change Here - comment out </li>
>  ********************
>   </li>
> -->
> </xsl:template>
>
>
> The problem here is that for example when using a para in listitem tag ,
> the <p> tag gets added after my number .  I don't want the break.   I
> somehow need my variable $blah to be moved to go right after the first
> <p> tag  from the first para element in listitem , but this variable
> needs to be created still in this orderedlist/listitem template.  Anyone
> have a clue on the best way to do this when keeping in mind, the
> variable $blah will most likely need this same procedure done for each
> child element of listitem??????
>
>
>
> Thank you
>
> Jason Black
> jblack@limacorp.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
>




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]