From: Norman W. <nw...@us...> - 2002-05-12 11:21:44
|
Update of /cvsroot/docbook/xsl/html In directory usw-pr-cvs1:/tmp/cvs-serv11905 Modified Files: xref.xsl Log Message: Support xref to refnamediv and all elements with titles (at least when they have titles) Index: xref.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/html/xref.xsl,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** xref.xsl 7 May 2002 07:42:32 -0000 1.26 --- xref.xsl 12 May 2002 11:21:41 -0000 1.27 *************** *** 90,96 **** <a href="{$href}"> ! <xsl:attribute name="title"> ! <xsl:apply-templates select="$target" mode="xref-title"/> ! </xsl:attribute> <xsl:apply-templates select="$target" mode="xref-to"/> </a> --- 90,98 ---- <a href="{$href}"> ! <xsl:if test="$target/title or $target/*/title"> ! <xsl:attribute name="title"> ! <xsl:apply-templates select="$target" mode="xref-title"/> ! </xsl:attribute> ! </xsl:if> <xsl:apply-templates select="$target" mode="xref-to"/> </a> *************** *** 127,130 **** --- 129,157 ---- </xsl:template> + <xsl:template match="title" mode="xref-to"> + <!-- if you xref to a title, xref to the parent... --> + <xsl:choose> + <!-- FIXME: how reliable is this? --> + <xsl:when test="contains(local-name(parent::*), 'info')"> + <xsl:apply-templates select="parent::*[2]" mode="xref-to"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="parent::*" mode="xref-to"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="abstract|article|authorblurb|bibliodiv|bibliomset + |biblioset|blockquote|calloutlist|caution|colophon + |constraintdef|formalpara|glossdiv|important|indexdiv + |itemizedlist|legalnotice|lot|msg|msgexplan|msgmain + |msgrel|msgset|msgsub|note|orderedlist|partintro + |productionset|qandadiv|refsynopsisdiv|segmentedlist + |set|setindex|sidebar|tip|toc|variablelist|warning" + mode="xref-to"> + <!-- catch-all for things with (possibly optional) titles --> + <xsl:apply-templates select="." mode="object.xref.markup"/> + </xsl:template> + <xsl:template match="author|editor|othercredit|personname" mode="xref-to"> <xsl:call-template name="person.name"/> *************** *** 299,302 **** --- 326,337 ---- </xsl:choose> <xsl:apply-templates select="refmeta/manvolnum"/> + </xsl:template> + + <xsl:template match="refnamediv" mode="xref-to"> + <xsl:apply-templates select="refname[1]" mode="xref-to"/> + </xsl:template> + + <xsl:template match="refname" mode="xref-to"> + <xsl:apply-templates mode="xref-to"/> </xsl:template> |