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] general approach to image maps

I've been meaning to modularize that big process.image template to make it 
easier to customize.  Maybe by 1.72.

You could instead customize the template named process.image.attributes 
from html/graphics.xsl.  It is called by process.image, it is only about 
100 lines, and its purpose is to add attributes to img.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

----- Original Message ----- 
From: "Georges Schmitz" <georges.schmitz@arcor.de>
To: <docbook-apps@lists.oasis-open.org>
Sent: Thursday, November 02, 2006 1:09 AM
Subject: [docbook-apps] general approach to image maps

> I'm searching for a general approach for using image maps with DocBook
> and I'm not referring to the image maps of callout objects.
> I'm using graphviz to produce PNGs and the corresponding MAP files, so I
> can rely on correctly calculated maps. All I need is a meaningful place
> for leaving some information that a specific image comes along with a
> map (which of course - as external code - needs to be included into the
> html code).
> If I would just have to insert the map content directly after the <img>
> tag, one could surely argue, that a PI (eg. dbhtml-include) could do the
> job (similar to what Bob mentions in
> http://www.sagehill.net/docbookxsl/InsertExtHtml.html#CodeInPage). But
> this will not work for 2 reasons:
>   1. PIs are only processed outside figure markup (eg. only explicit
>      apply-templates="imagedata" in imageobject prevent PIs to become
>      effective)
>   2. I need a usemap attribute directly in the img tag
> Currently for me a straightforward approach would be something like the
> following:
>      <figure>
>         <title>ER diagram (compact) of Type Certification</title>
>         <mediaobject>
>            <imageobject role="fo">
>               <imagedata depth="22cm" height="22cm" format="SVG"
> fileref="../dot/tc-compact.svg"/>
>            </imageobject>
>            <imageobject role="html">
>               <imagedata format="PNG" fileref="../dot/tc-compact.png"/>
>               <?imagemap fileref="../dot/tc-compact.map"?>
>            </imageobject>
>         </mediaobject>
>      </figure>
> But where to start? There are 2 templates to deal with, when I
> want to introduce such functionality in a customization layer
> (A) (very simple)
> <xsl:template match="imageobject">
> just needs to be extended with a <xsl:apply-templates
> select="processing-instruction()"/> for loading the map and pasting it
> into the html code.
> (B) (with 800 lines to big for a customization layer in my opinion)
> <xsl:template name="process.image">
> In (A) I would load the map into a variable, extract the map name or id,
> pass it over as parameter "usemap" to the imagedata template which in
> its turn passes it to the named template "process.image" (B).
> But what should I do with <xsl:template name="process.image">? As I
> already said, I don't think that copying and pasting such a template
> into a customization layer is the right approach. Should I extend it
> first on my own and than file a request to see appear such functionality
> in the main distribution?
> Thanks,
> Georges
> ---------------------------------------------------------------------
> 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]