[oXygen-user] areaspec feature in docbook

Sorin Ristache
Thu Sep 14 09:19:47 CDT 2006

Hello Achim,

You don't need the DocBook extensions for graphic callouts because you 
have to compute yourself the coordinates of the callout areas and to add 
the callout markers to the image. You specified units="calspair" but you 
did not specify the area coordinates in the CALS system. The result is 
the NaN coordinates in the HTML map area. A correct example is:

  <areaspec units="calspair">
    <areaset id="oneway-area" linkends="oneway">
      <area id="id1" coords="0,2500 2500,0"/>
      <area id="id2" coords="2500,5000 5000,2500"/>
    <area id="myhouse-area" coords="5000,10000 10000,5000" 

For each area you have to specify two pairs, for the upper left corner 
and the lower right corner of the callout area. You can read about CALS 
coordinates in "DocBook: The Definitive Guide":


Also you need a pointer to the target of the link which is represented 
by the clickable area. You specify that with the linkends attribute of 
area/areaset which must be the ID of the target callout, for example:

     <callout id="oneway" arearefs="oneway-area">
        <para>Oneway callout</para>
     <callout id="myhouse" arearefs="myhouse-area">
        <para>Myhouse callout</para>

Norman Walsh created two Perl scripts for speeding up the computation of 
the CALS coordinates of callout areas and the addition of the callout 
markers to the image:


Best regards,

Achim Oehlenschlaeger wrote:
> Hello,
> I'm using Oxygen 7.2 and want to use the areaspec feature to define 
> linkable
> areas in a graphics object.
> I tried the example from 
> http://www.docbook.org/tdg/en/html/mediaobjectco.html
> but don't get the desired result.
> I did read and follow the readme file in:
>  ...\Oxygen XML Editor 7.2\frameworks\docbook\xsl\extensions
> I tried the Docbook transformation scenario as delivered with oxygen first,
> than I also added the DocBook extension to the scenario, than I switched 
> to Xalan
> (I also switched the extension) but the result is always the same as 
> shown below.
> Thanks,
> Achim
> Input:
> ------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE mediaobjectco PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
>  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
> <mediaobjectco>
>     <imageobjectco>
>         <areaspec units="calspair">
>             <areaset id="oneway" coords="">
>                 <area id="oneway1" coords="300 400"/>
>                 <area id="oneway2" coords="325 340"/>
>             </areaset>
>             <area id="myhouse" coords="425 590"/>
>         </areaspec>
>         <imageobject>
>             <imagedata 
> fileref="http://maps.example.com/EARTH?USA?MA?01007"/>
>         </imageobject>
>     </imageobjectco>
> </mediaobjectco>
> Output:
> -------
> <html>
>     <head>
>         <META http-equiv="Content-Type" content="text/html; 
> charset=ISO-8859-1"><title></title>
>          <meta content="DocBook XSL Stylesheets V1.70.1" name="generator">
>     </head><body bgcolor="white" text="black" link="#0000FF" 
> vlink="#840084" alink="#0000FF">
>         <div class="mediaobjectco">
>             <img border="0" usemap="N10003" 
> src="http://maps.example.com/EARTH?USA?MA?01007">
>                 <map name="N10003"><area shape="rect" 
> coords="NaN,NaN,NaN,NaN">
>                     <area shape="rect" coords="NaN,NaN,NaN,NaN">
>                         <area shape="rect" coords="NaN,NaN,NaN,NaN">
>                 </map>
>         </div>
>     </body>
> </html>

More information about the oXygen-user mailing list