[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: 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
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]