old-www/LDP/LDP-Author-Guide/html/oo2docbook.html

543 lines
10 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>OpenOffice.org to DocBook</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="LDP Author Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="Converting Documents to DocBook XML"
HREF="x2docbook.html"><LINK
REL="PREVIOUS"
TITLE="Text to DocBook"
HREF="txt2docbook.html"><LINK
REL="NEXT"
TITLE="Microsoft Word to DocBook"
HREF="word2docbook.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>LDP Author Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="txt2docbook.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Appendix E. Converting Documents to DocBook XML</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="word2docbook.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="oo2docbook"
></A
>E.2. OpenOffice.org to DocBook</H1
><P
>As of <A
HREF="http://www.openoffice.org"
TARGET="_top"
>OpenOffice.org (OOo)</A
> 1.1RC there has been support for
exporting files to DocBook format.</P
><P
>Although OOo uses the full DocBook document type declaration,
it does not actually export the full list of DocBook elements. It
uses a <SPAN
CLASS="QUOTE"
>"simplified"</SPAN
> DocBook tag set which is geared
to on-the-fly rendering. (Although it is not the official
Simplified DocBook which is described in <A
HREF="dtd.html"
>Section B.5</A
>.)
The OpenOffice simplified (or <SPAN
CLASS="QUOTE"
>"special"</SPAN
> docbook) is available from
<A
HREF="http://www.chez.com/ebellot/ooo2sdbk/"
TARGET="_top"
>http://www.chez.com/ebellot/ooo2sdbk/</A
>.</P
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="ooo-1-0"
></A
>E.2.1. Open Office 1.0.x</H2
><P
>&#13; OOo has been tested by LDP volunteers with mostly positive
results. Thanks to Charles Curley
(<A
HREF="http://www.charlescurley.com"
TARGET="_top"
>charlescurley.com</A
>)
for the following notes on using OOo version 1.0.x:
</P
><DIV
CLASS="note"
><P
></P
><TABLE
CLASS="note"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="../images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TH
ALIGN="LEFT"
VALIGN="CENTER"
><B
>Check the version of your OpenOffice</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>&#13; These notes may not apply to the version of OOo you
are using.
</P
></TD
></TR
></TABLE
></DIV
><P
></P
><UL
><LI
><P
>&#13; To be able to export to DocBook, you must have a Java runtime
environment (JRE) installed and registered with OOo--a minimum of
version 4.2.x is recommended. The configuration instructions will
depend on how you installed your JRE. Visit the OOo web site for
help with your setup.
</P
><P
>&#13; Contrary to the OOo documentation, the Linux OOo did not come with
a JRE. I got one from Sun.
</P
></LI
><LI
><P
>The exported file has lots of empty lines. My 54 line exported
file
had 5 lines of actual XML code.</P
></LI
><LI
><P
>There was no effort at pretty printing.</P
></LI
><LI
><P
> The header is:
<TT
CLASS="computeroutput"
>&#13; &#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"&#62;
</TT
>
</P
></LI
><LI
><P
> The pull-down menu in the <SPAN
CLASS="guimenu"
>File</SPAN
>-&gt;<SPAN
CLASS="guimenuitem"
>Save
As</SPAN
> dialog box for
file format
indicates that the export format is <SPAN
CLASS="QUOTE"
>"DocBook (simplified)."</SPAN
> There is
no explanation of what that <SPAN
CLASS="QUOTE"
>"simplified"</SPAN
> indicates. Does OOo export
a subset of DocBook? If so, which elements are ignored? Is there any
way to enter any of them manually?
</P
></LI
><LI
><P
> There is NO documentation on the DocBook export filter
or whether
OOo will import it again.
</P
></LI
></UL
><P
>&#13; Conclusions: OOo 1.1RC is worth looking at if you want a word
processor for preparing DocBook documents.
</P
><P
>However, I hope they cure the lack of documentation. For one
thing, it would be nice to know which native OOo styles map to
which DocBook elements. It would also be nice to know how to
map one's own OOo styles to DocBook elements.</P
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="ooo-1-1"
></A
>E.2.2. Open Office 1.1</H2
><P
>&#13; <A
HREF="http://www.merlinmonroe.com"
TARGET="_top"
>Tabatha Marshall</A
>
offers the following additional information for OOo 1.1.
</P
><A
NAME="AEN3622"
></A
><BLOCKQUOTE
CLASS="BLOCKQUOTE"
><P
> The first problem was when I tried to do everything on version
1.0.1. That was
obviously a problem. I have RH8, and it was installed via rpm packages,
so I ripped it out and did a full, new install of OpenOffice 1.1.
It took a while to find out 1.1 was a requirement for XML to work.
</P
><P
>&#13;During the install process I believe I was offered the choice to install
the XML features. I have a tendency to do full installs of my office
programs, so I selected everything.
</P
><P
>&#13;I can't offer any advice to those trying to update their current
OO 1.1. Their <SPAN
CLASS="QUOTE"
>"3 ways"</SPAN
> aren't documented very well at the site
(<A
HREF="http://xml.openoffice.org"
TARGET="_top"
>xml.openoffice.org</A
>) and as of this writing, I can't even find THAT
on their site anymore. I think more current documentation is needed
there to walk people through the process. Most of this was unclear
and I had to pretty much experiment to get things working.
</P
><P
>&#13;Well, after I installed everything I had some configuration to do.
I opened the application, and got started by opening a new file,
choosing templates, then selecting the DocBook template. A nice menu
of <SPAN
CLASS="guisubmenu"
>Paragraph Styles</SPAN
> popped up for me, which are the names for all those
tags, I noticed (you can see I don't use WYSIWYG often).
</P
><P
>&#13; With a blank doc before me (couldn't get to the <SPAN
CLASS="guisubmenu"
>XML Filter
Settings</SPAN
> menu unless some type of doc was opened), I went into
<SPAN
CLASS="guimenu"
>Tools</SPAN
>-&gt;<SPAN
CLASS="guimenuitem"
>XML
Filter Settings</SPAN
>, and edited the entry for DocBook file.
I configured mine as follows:
</P
><P
></P
><UL
><LI
><P
>&#13; <SPAN
CLASS="guilabel"
>Doctype</SPAN
>
<TT
CLASS="userinput"
><B
>-//OASIS//DTD DocBook XML V4.2//EN</B
></TT
>
</P
></LI
><LI
><P
>&#13; <SPAN
CLASS="guilabel"
>DTD</SPAN
>
<TT
CLASS="userinput"
><B
>http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd</B
></TT
>
</P
></LI
><LI
><P
>&#13; <SPAN
CLASS="guilabel"
>XSLT for export</SPAN
>
<TT
CLASS="userinput"
><B
>/usr/local/OpenOffice.org1.1.0/share/xslt/docbook/ldp-html.xsl</B
></TT
>
</P
></LI
><LI
><P
>&#13; <SPAN
CLASS="guilabel"
>XSLT for import</SPAN
>
<TT
CLASS="userinput"
><B
>/usr/local/OpenOffice.org1.1.0/share/xslt/docbook/docbooktosoffheadings.xsl</B
></TT
>
(this is the default)
</P
></LI
><LI
><P
>&#13; <SPAN
CLASS="guilabel"
>Template for import</SPAN
>
<TT
CLASS="userinput"
><B
>/home/tabatha/OpenOffice/user/template/DocBook
File/DocBookTemplate.stw</B
></TT
>
</P
></LI
></UL
><P
>&#13;At first, if I opened an XML file that had even one parsing error, it
would just open the file anyway and display the markup in OO. I have
many XML files that use &#38;copy; and other types of entities which show
up as parse errors (depending on the encoding) even though they can be
processed through. But today I was unable to open any of those files.
I got input/output errors instead. Still investigating that one.
</P
><P
>&#13;However when you do successfully open a document (one parsing with no
errors), it puts it automatically into WYSIWYG based on the markup,
and you can then work from the paragraph styles menu like any other
such editor.
</P
><P
>&#13;To validate the document, I used <SPAN
CLASS="guimenu"
>Tools</SPAN
>-&gt;<SPAN
CLASS="guimenuitem"
>XML
Filter Settings</SPAN
>, then
clicked the <SPAN
CLASS="guibutton"
>Test XSLTs</SPAN
> button. On my screen, I set up the XSLT
for export to be <TT
CLASS="filename"
>ldp-html.xsl</TT
>. If you test and there are errors,
a new window pops up with error messages at the bottom, and the lines
that need to be changed up at the top. You can change them there and
progress through the errors until they're all gone, and keep testing
until they're gone.
</P
><P
>&#13;If you want to open a file to see the source instead of the processed
results, go to <SPAN
CLASS="guimenu"
>Tools</SPAN
>-&gt;<SPAN
CLASS="guimenuitem"
>XML Filter
Settings</SPAN
>-&gt;<SPAN
CLASS="guisubmenu"
>Test XSLTs</SPAN
>, and then
under the <SPAN
CLASS="guimenu"
>Import</SPAN
> section, check the
<SPAN
CLASS="guilabel"
>Display Source</SPAN
> box. My import XSLT
is currently <TT
CLASS="filename"
>docbooktosoffheadings.xsl</TT
> (the default) and the template
for import is <TT
CLASS="filename"
>DocBookTemplate.stw</TT
> (also default).
</P
><P
>&#13;I think this might work for some people, but unfortunately not for me.
I've never used WYSIWYG to edit markup. <SPAN
CLASS="application"
>Emacs with
PSGML</SPAN
> can tell me
what my next tag is no matter where I am, validate by moving through
the trouble spots, and I can parse and process from command line.
</P
><P
>&#13;With OpenOffice, you have to visit <A
HREF="http://xml.openoffice.org/filters.html"
TARGET="_top"
>http://xml.openoffice.org/filters.html</A
>
to find conversion tools.
</P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="txt2docbook.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="word2docbook.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Text to DocBook</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="x2docbook.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Microsoft Word to DocBook</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>