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: xslt for imageobject link


Hi,

I have the following snippet :
<mediaobject>
  <imageobject>
    <imagedata fileref="IMG-500.JPG"/>
  </imageobject>
  <imageobject condition="original">
    <imagedata fileref="IMG.JPG"/>
  </imageobject>
  <caption>
    <para>
      This is a picture
    </para>
  </caption>
</mediaobject>

I would like to produce this html or some version there of :

..
<img src="IMG-500.JPG" />
<a href="IMG.JPG">Original</a>
<p> This is a picture</p>
..

My initial attempt to do this was :

<xsl:template match="d:imageobject[@condition='original']">
<xsl:text> (</xsl:text>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="imageobject/imagedata/@fileref"”/>
</xsl:attribute>
<span>Original</span>
</xsl:element>
<xsl:text>)</xsl:text>
</xsl:template>

But that has so far failed.

Has it to do with the special treatment of mediaobjects in
<xsl:template name="select.mediaobject">  ?

Do I have to set count to 2 ?

Any other hints or ideas for this ?
I want to put the scaled image 27k on the website and not the original 2.4 Mb, but still have it accessible.

The above docbook gets generated if an image is too large, original docbook is :
 <mediaobject>
    <imageobject><imagedata fileref="IMG.JPG"/></imageobject>
    <caption>
      <para>
        This is a picture
      </para>
    </caption>
  </mediaobject>

Thanks,

Fredrik Unger


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