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] mediaobject with base64 encoded image data


On 3.4.2012 13:35, Dominik Psenner wrote:

>> There is no need to change anything on DocBook side to support this.
>> Simply put data: into fileref attribute.
> 
> That doesn't work together with the IBEX processor because "data:.." is
> wrapped into "url(data:..)" and then the processor treats "data:.." as an
> url, which it is not and thus the image is not rendered as the data of the
> image can't be retrieved from the path "data:.." unless it exists by
> coincidence.

But data: is URL, see http://www.ietf.org/rfc/rfc2397

If IBEX can handle this, then it is clearly IBEX bug.

>> There migh be needed some small
>> changes in XSL stylesheets in order to skip usual file path massaging.
> 
> That would be the template named "fo-external-image" in graphics.xsl, isn't
> it?

No, it's

<xsl:template name="image.src">
  <xsl:param name="filename"/>

  <xsl:choose>
    <xsl:when test="svg:*" xmlns:svg="http://www.w3.org/2000/svg";>
      <!-- no src attribute for inline SVG content -->
    </xsl:when>
    <xsl:when test="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML";>
      <!-- no src attribute for inline MathML content -->
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="fo-external-image">
        <xsl:with-param name="filename">
          <xsl:if test="$img.src.path != '' and
                        not(starts-with($filename, '/')) and
                        not(contains($filename, '://'))">
            <xsl:value-of select="$img.src.path"/>
          </xsl:if>
          <xsl:value-of select="$filename"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

Test should be added not to prepend img.src.path when $filename starts
with data:

Also there are other places where extension functions to measure image
are invoked. They probably need some modification as well.

>> Also I think that even data: should be wrapped in url() otherwise it
>> would be non-conforming to XSL-FO spec.
> 
> At least the implemented IBEX interpretation of the XSL-FO spec doesn't
> behave like that.

It's not only IBEX, you can modify existing template and compensate for
IBEX as well:

<xsl:template name="fo-external-image">
  <xsl:param name="filename"/>

  <xsl:choose>
    <xsl:when test="$passivetex.extensions != 0
                    or $fop.extensions != 0">
      <xsl:value-of select="$filename"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="concat('url(', $filename, ')')"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

Just add $ibex.extension and omit url() if it is set to 1.

					Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature



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