| View previous topic :: View next topic |
| Author |
Message |
darya General User

Joined: 10 Aug 2006 Posts: 24 Location: Germany
|
Posted: Fri Aug 11, 2006 12:31 am Post subject: How to get MS Word graphics into DocBook XML w/ OOo 2.0.3? |
|
|
Hi,
after solving my first problem, creating DocBook XML w/ OOo 2.0.3 at http://www.oooforum.org/forum/viewtopic.phtml?t=41154 I have now a problem when exporting MS Word documents which contain graphics
Is there a way to get MS Word documents with graphics into a DocBook XML file through OpenOffice Writer 2.0.3
Regards,
Darya |
|
| Back to top |
|
 |
darya General User

Joined: 10 Aug 2006 Posts: 24 Location: Germany
|
Posted: Fri Aug 11, 2006 1:54 am Post subject: |
|
|
It's very easy to reproduce.
- Create MS Word Document with one line "Hello World" and one graphic of your choice.
- Open new MS Word document in OpenOffice Writer.
- Save the document As DocBook XML
The resulting DocBook XML will be someting like:
| Code: |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<article lang="de-DE">
<para>Hello World!</para>
<para/>
<para>
<inlinegraphic fileref="" width=""/>
</para>
</article>
|
The line <inlinegraphic fileref="" width=""/> is empty
Any hints
Regards,
Darya |
|
| Back to top |
|
 |
darya General User

Joined: 10 Aug 2006 Posts: 24 Location: Germany
|
Posted: Fri Aug 11, 2006 2:30 am Post subject: Maybe I can write myself the missing graphic transformation |
|
|
Interestingly the transformation XSL for .doc to .odt did work fine, because here the graphic from my MS Word document is included. But Saving As DocBook (.xml) from .doc or .odt is doing nothing with these graphic .
The first step I would do is to check the transformation XSL for transforming OpenOffice's internal representation of my MS Word document to the DocBook XML. So far I've no clue how the internal OpenOffice representation looks like but shouldn't it be an XML by itself
I mean I use a transformation XSL always between an Input XML and and Output XML. So because the internal OpenOffice representation holds the reference to the graphic it must somehow be possible to transform this information into the output DocBook XML file
Of course I prefer to take the line of the least resistance.
Any hints are welcome.
Regards,
Darya |
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
Posted: Fri Aug 11, 2006 6:57 am Post subject: Re: Maybe I can write myself the missing graphic transformat |
|
|
| darya wrote: | | ... how the internal OpenOffice representation looks like but shouldn't it be an XML by itself ? |
If you save a file as an .odt you can see the contents by renaming it .zip and then "unzipping" it.
You can look at the content.xml file in a text editor. If the images in the document have been saved with the link box unchecked you will find lines like these:
| Code: | <draw:frame draw:style-name="fr1" draw:name="graphics1" text:anchor-type="paragraph" svg:width="14.649cm" svg:height="7.682cm" draw:z-index="1">
<draw:image xlink:href="Pictures/100000000000063E000003463ECDAB4F.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
</draw:frame> |
and if you save with the link box checked:
| Code: | <draw:frame draw:style-name="fr1" draw:name="graphics1" text:anchor-type="paragraph" svg:width="14.649cm" svg:height="7.682cm" draw:z-index="1">
<draw:image xlink:href="[RELATIVE_PATH_TO_PICTURE_FOLDER]/image.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="<All formats>"/>
</draw:frame> |
Presumably you could edit one to the other and then re-zip the contents of the .odt back together again. |
|
| Back to top |
|
 |
darya General User

Joined: 10 Aug 2006 Posts: 24 Location: Germany
|
Posted: Mon Aug 14, 2006 3:22 am Post subject: |
|
|
I don't like the copy paste idea
Any more hints  |
|
| Back to top |
|
 |
|