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] Assigning an ID and a class to <mediaobject> HTML output


Hi David,

Regarding a class attribute, the <div> element output for a mediaobject has a generic class="mediaobject" attribute. You can modify that by customizing a template in mode="class.value" as described here:

http://www.sagehill.net/docbookxsl/HtmlCustomEx.html#CustomClassValues

I looked into the id issue, and there is a param named 'generate.id.attributes' in the DocBook HTML stylesheet. But it only applies to container elements and not mediaobject.

In your case, I would suggest creating a template in mode="class.attribute" instead of "class.value", and have it generate the id attribute as well as the class attribute. Something like this:

<xsl:template match="d:mediaobject" mode="class.attribute">
 <xsl:attribute name="class">
   <xsl:choose>
     [your logic for generating a class value]
   </xsl:choose>
 </xsl:attribute>
 <xsl:if test="@id">
   <xsl:attribute name="id">
     <xsl:value-of select="@id"/>
   </xsl:attribute>
 </xsl:if>
</xsl:template>


Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- From: "David Goss" <dgoss@mueller-inc.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, March 06, 2012 10:35 AM
Subject: [docbook-apps] Assigning an ID and a class to <mediaobject> HTML output


I would like to use a Javascript fancyzoom() with images in a Docbook
HTML output. Basically, all the images would float right and be of equal
width, and could be clicked to zoom.

My problem is that setting xml:id='theimagename' and role='thumbnail' in
mediaobject (or imageobject and imagedata) doesn't seem to add an id or
a class to the HTML output. Is there some way I can explicitly tell the
transformation sheet that I want the id and class in the output?


DAVID GOSS | Technical Writer
P 1.800.876.9218 x 345 | F 1.800.588.9866
dgoss@mueller-inc.com
http://www.MuellerReports.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]