Hi Antti,
Undoubtedly you are aware that WordML and DocBook have different
storage models for image data. DocBook is similar to HTML in that
images are linked to (ie. the image data is stored in a separate
file). WordML stores image data embedded in the XML as base-64
encoded data.
With XSLT the only thing that can be done with this data is to write
it to a separate file (and then only if you have the xsl:document, or
its equivalent, extension element available). The problem then is how
to decode the base-64 into the binary image data. Of course, there is
the opposite problem when converting a DocBook document to WordML; the
image data must be read from the file and base-64 encoded.
MS Office 2007, Apple Pages and Open Office each do things a bit
differently, and I am currently investigating how to handle images in
those formats.
In the roundtripping system, at present images are supported as
hypertext references, where the target of the reference (ie. the value
of the @fileref attribute) is the content of the paragraph.
For the WordML-to-DocBook conversion, when an embedded image is
encountered in the document the stylesheet will attempt to write the
base-64 encoded data into a new file and then use that file's filename
as the URI for the @fileref attribute. How you then decode the image
data is up to you.
Regarding image metadata, titles for <figure> elements are supported
and must appear immediately before the image reference. Captions are
also supported and must appear after the image reference. Anything in
between the image reference and the caption becomes the content of the
textobject element. If you want to have a textobject element without
a caption, then you must insert an empty caption-styled paragraph.
BTW, I am planning on producing documentation for these editorial
rules. Honest ;-)
HTHs,
Steve Ball
On 08/01/2008, at 12:35 AM, Antti Karanta wrote:
Hi!
I was wondering what image formats are supported in docbook to
wordml transformation. I did a little experiment and only the image
names turned out in the transformed wordml document.
So, I had a look at the roundtrip/docbook.xsl stylesheet, and with
my limited xsl knowledge, it seems that this is the only support
there is for any kind of images, at least using the mediaobject
element containing one or more imageobjects w/ imagedata pointing to
an external file w/ fileref, e.g.
<mediaobject id="mypic">
<imageobject role="fo">
<imagedata format="SVG" fileref="image.svg"/>
</imageobject>
<imageobject role="html">
<imagedata format="PNG" fileref="slides.png"/>
</imageobject>
<textobject>
<para>alternative text</para>
</textobject>
</mediaobject>
is rendered as just
"""
image.svg
slides.png
Text Object 1
alternative text
"""
Are images not supported at all in the transformation from docbook
to wordml?
Or is it just not yet supported?
Or did I miss something?
-Antti-
Ps. I'm using docbook-xsl-snapshot from monday.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
open.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]