From: Michael S. <xm...@us...> - 2005-06-24 07:20:49
|
Update of /cvsroot/docbook/xsl/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6150 Modified Files: inline.xsl html.xsl Log Message: Added initial, EXPERIMENTAL support for generating content for HTML "title" attributes from content of the Alt element. This change adds support for generating HTML "title" attributes for the following inline elements only (all inlines -- support for block elements will need to wait for later). abbrev accel acronym action application authorinitials beginpage citation citerefentry citetitle city classname code command comment computeroutput constant country database email envar errorcode errorname errortext errortype exceptionname fax filename firstname firstterm foreignphrase function glossterm guibutton guiicon guilabel guimenu guimenuitem guisubmenu hardware honorific interface interfacedefinition interfacename keycap keycode keysym lineage lineannotation literal markup medialabel methodname mousebutton option optional otheraddr othername package parameter personname phone pob postcode productname productnumber prompt property quote refentrytitle remark replaceable returnvalue sgmltag shortcut state street structfield structname subscript superscript surname symbol systemitem tag termdef token trademark type uri userinput varname wordasword Implemented by creating a new named template, generate.html.title. That is is currently called in eleven places only, in the inline.xsl file. But it's called by all the inline.* templates (e.g., inline.boldseq), which in turn are called by other (element) templates, so it results, currently, in supporting generation of the HTML "title" attribute for a total of about 93 elements (the list above). Index: inline.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/html/inline.xsl,v retrieving revision 1.41 retrieving revision 1.42 diff -u -U2 -r1.41 -r1.42 --- inline.xsl 4 Apr 2005 13:33:51 -0000 1.41 +++ inline.xsl 24 Jun 2005 07:20:39 -0000 1.42 @@ -117,4 +117,5 @@ </xsl:param> <span class="{local-name(.)}"> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -136,4 +137,5 @@ </xsl:param> <code class="{local-name(.)}"> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -156,4 +158,5 @@ <span> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -189,4 +192,5 @@ </xsl:param> <em class="{local-name(.)}"> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -216,4 +220,5 @@ or local-name(../..) = 'formalpara')"> <code class="{local-name(.)}"> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -227,4 +232,5 @@ <strong class="{local-name(.)}"> <code> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -250,4 +256,5 @@ <em class="{local-name(.)}"> <code> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -270,4 +277,5 @@ </xsl:param> <sup> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -289,4 +297,5 @@ </xsl:param> <sub> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@dir"> <xsl:attribute name="dir"> @@ -668,4 +677,5 @@ <xsl:template match="phrase"> <span> + <xsl:call-template name="generate.html.title"/> <xsl:if test="@lang or @xml:lang"> <xsl:call-template name="language.attribute"/> @@ -920,4 +930,5 @@ <xsl:template match="termdef"> <span class="{local-name(.)}"> + <xsl:call-template name="generate.html.title"/> <xsl:call-template name="gentext.template"> <xsl:with-param name="context" select="'termdef'"/> @@ -947,4 +958,5 @@ <code class="sgmltag-{$class}"> + <xsl:call-template name="generate.html.title"/> <xsl:choose> <xsl:when test="$class='attribute'"> Index: html.xsl =================================================================== RCS file: /cvsroot/docbook/xsl/html/html.xsl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -U2 -r1.9 -r1.10 --- html.xsl 4 Apr 2005 13:26:29 -0000 1.9 +++ html.xsl 24 Jun 2005 07:20:40 -0000 1.10 @@ -13,4 +13,19 @@ ******************************************************************** --> +<!-- The generate.html.title template is currently used for generating HTML --> +<!-- "title" attributes for some inline elements only, but not for any --> +<!-- block elements. It is called in eleven places in the inline.xsl --> +<!-- file. But it's called by all the inline.* templates (e.g., --> +<!-- inline.boldseq), which in turn are called by other (element) --> +<!-- templates, so it results, currently, in supporting generation of the --> +<!-- HTML "title" attribute for a total of about 92 elements. --> +<xsl:template name="generate.html.title"> + <xsl:if test="alt"> + <xsl:attribute name="title"> + <xsl:value-of select="alt"/> + </xsl:attribute> + </xsl:if> +</xsl:template> + <xsl:template name="anchor"> <xsl:param name="node" select="."/> |