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] Image callouts and roles

Indeed.  Here is the update to the template for the imageobjectco element I was going to check in.  It should work equally well in an html or fo customization layer. It uses the same mechanism to select a role attribute.  The difference from mediaobject is that it only does the selection if the right conditions are met, on the assumption that you may intend to have multiple imageobjects in your output.   Let me know if it works for you.
<xsl:template match="imageobjectco">
    <!-- select one imageobject? -->
    <xsl:when test="$use.role.for.mediaobject != 0 and
                    count(imageobject) &gt; 1 and
      <xsl:variable name="olist" select="imageobject"/>
      <xsl:variable name="object.index">
        <xsl:call-template name="select.mediaobject.index">
          <xsl:with-param name="olist" select="$olist"/>
          <xsl:with-param name="count" select="1"/>
      <xsl:variable name="object" select="$olist[position() = $object.index]"/>
      <xsl:apply-templates select="$object"/>
      <!-- otherwise process them all -->
      <xsl:apply-templates select="imageobject"/>
  <xsl:apply-templates select="calloutlist"/>
Bob Stayton
Sagehill Enterprises
----- Original Message -----
From: Chris Ridd
Sent: Monday, October 03, 2011 5:43 AM
Subject: Re: [docbook-apps] Image callouts and roles

On 03 Oct, 2011,at 11:37 AM, Bob Stayton <bobs@sagehill.net> wrote:

Hi  Chris,
OK.  Prior to Docbook 5, imageobjectco only allowed one imageobject, so that is the case that the stylesheet currently handles.  I did not realize that more  than one was allowed in DocBook 5, so that will need  to get fixed in the stylesheets. I filed a bug report.

Thanks; sorry for messing up the original test case.

For now, the selection process applies only to the direct children of mediaobject.  That's why you are getting both images in your output.  You'll need to create two children of mediaobject for the selection to work.

Indeed that works (rendering one image) but I think it leaves me with a different problem :-)

The reason I'm using an imageobjectco is because after the (in this case) 'screenshot' element I've got a calloutlist which has callout elements referencing various areas on the imageobjectco.

Now if I'm using multiple 'imageobjectco' elements, each would have a separate 'areaspec', and each 'areaspec' would have a separate list of 'area's. Because the 'callout' has to reference the area by its xml:id, this looks to me like I'd need to create two 'area' elements with the same xml:id. Not good!

If I create areas with different xml:ids, I can use <callout arearefs="fo-id1 html-id1"><para>text</para></callout> in my calloutlist, however that gets rendered as "(1)(1) text". eg

        <imageobjectco role="fo">
            <area coords="500,500,600,600" xml:id="fo-id1"/>
            <imagedata fileref="/path/to/fo.png"/>
        <imageobjectco role="html">
            <area coords="500,500,600,600" xml:id="html-id1"/>
            <imagedata fileref="/path/to/html.png"/>
      <callout arearefs="fo-id1 html-id1">

(Both variants there are using PNGs, just for simplicity. In reality one would be an SVG and the other would be PNG.)



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]