From: Norman W. <nw...@us...> - 2001-09-22 14:16:41
|
Update of /cvsroot/docbook/xsl/common In directory usw-pr-cvs1:/tmp/cvs-serv12896/common Modified Files: gentext.xsl labels.xsl Log Message: Bug #463033: allow xref to list items (in orderedlists) and varlistentrys Index: gentext.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/common/gentext.xsl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** gentext.xsl 2001/08/01 00:43:27 1.10 --- gentext.xsl 2001/09/22 14:16:38 1.11 *************** *** 158,182 **** </xsl:template> ! <xsl:template match="section|simplesect ! |sect1|sect2|sect3|sect4|sect5 ! |refsect1|refsect2|refsect3 ! |bridgehead" ! mode="object.xref.markup"> ! <xsl:variable name="template"> ! <xsl:apply-templates select="." mode="object.xref.template"/> ! </xsl:variable> ! ! <!-- ! <xsl:message> ! <xsl:text>object.xref.markup: </xsl:text> ! <xsl:value-of select="local-name(.)"/> ! <xsl:text>: </xsl:text> ! <xsl:value-of select="$template"/> ! </xsl:message> ! --> ! ! <xsl:call-template name="substitute-markup"> ! <xsl:with-param name="template" select="$template"/> ! </xsl:call-template> </xsl:template> --- 158,180 ---- </xsl:template> ! <xsl:template match="listitem" mode="object.xref.markup"> ! <xsl:choose> ! <xsl:when test="parent::orderedlist"> ! <xsl:variable name="template"> ! <xsl:apply-templates select="." mode="object.xref.template"/> ! </xsl:variable> ! <xsl:call-template name="substitute-markup"> ! <xsl:with-param name="template" select="$template"/> ! </xsl:call-template> ! </xsl:when> ! <xsl:otherwise> ! <xsl:message> ! <xsl:text>Xref is only supported to listitems in an</xsl:text> ! <xsl:text> orderedlist: </xsl:text> ! <xsl:value-of select="@id"/> ! </xsl:message> ! <xsl:text>???</xsl:text> ! </xsl:otherwise> ! </xsl:choose> </xsl:template> Index: labels.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/common/labels.xsl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** labels.xsl 2001/08/04 21:54:02 1.10 --- labels.xsl 2001/09/22 14:16:38 1.11 *************** *** 495,498 **** --- 495,526 ---- </xsl:template> + <xsl:template match="orderedlist/listitem" mode="label.markup"> + <xsl:variable name="numeration"> + <xsl:call-template name="list.numeration"> + <xsl:with-param name="node" select="parent::orderedlist"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="type"> + <xsl:choose> + <xsl:when test="$numeration='arabic'">1</xsl:when> + <xsl:when test="$numeration='loweralpha'">a</xsl:when> + <xsl:when test="$numeration='lowerroman'">i</xsl:when> + <xsl:when test="$numeration='upperalpha'">A</xsl:when> + <xsl:when test="$numeration='upperroman'">I</xsl:when> + <!-- What!? This should never happen --> + <xsl:otherwise> + <xsl:message> + <xsl:text>Unexpected numeration: </xsl:text> + <xsl:value-of select="$numeration"/> + </xsl:message> + <xsl:value-of select="1."/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:number count="listitem" format="{$type}"/> + </xsl:template> + <xsl:template match="abstract" mode="label.markup"> <!-- nop --> |