2120 lines
37 KiB
HTML
2120 lines
37 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Editing tools</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="System Setup: Editors, Validation and
|
|
Transformations"
|
|
HREF="tools.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Tools for your operating
|
|
system"
|
|
HREF="tools-distro.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Validation"
|
|
HREF="tools-validate.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="tools-distro.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Appendix B. System Setup: Editors, Validation and
|
|
Transformations</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="tools-validate.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H1
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-edit"
|
|
></A
|
|
>B.2. Editing tools</H1
|
|
><P
|
|
> Editing tools have come a long way in their support for
|
|
XML (and specifically DocBook). There are two types of
|
|
editors outlined in this section: text editors (emacs,
|
|
vim, etc); and word processors (OpenOffice, AbiWord,
|
|
etc). New authors who are not comfortable working with
|
|
markup languages should probably choose a word processor
|
|
that can output DocBook files. For this reason the word
|
|
processors are listed first.
|
|
</P
|
|
><P
|
|
> Although many editors can also validate your DocBook
|
|
files, this information has been separated into <A
|
|
HREF="tools-validate.html"
|
|
>Section B.3</A
|
|
>.
|
|
</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
|
|
>More info</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> Check the resources section for more .
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H2
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-word-processors"
|
|
></A
|
|
>B.2.1. Word Processors</H2
|
|
><P
|
|
> Even if you are not comfortable working DocBook's tagset
|
|
in a text editor you can still produce valid DocBook
|
|
documents using a word processor. Support at this point
|
|
is very limited, but it does exist in the following
|
|
programs. The up side, of course, is that things like
|
|
spell check are built in to the program. In addition to
|
|
this, support for DocBook (and XML) is constantly
|
|
improving.
|
|
</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
|
|
>Converting Microsoft Word documents</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> Even if you want to use MS Word to write your documents, you may
|
|
find <A
|
|
HREF="http://www.docsoft.com/w2xmlv2.htm"
|
|
TARGET="_top"
|
|
>w2XML</A
|
|
>
|
|
useful. Note that this is not free software--the cost is around $130USD.
|
|
There is, however, a trial version of the software.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><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
|
|
>Work on the content!</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> Remember that all formatting changes you make to your
|
|
document will be ignored when your document is released
|
|
by the LDP. Instead of focusing on how your document
|
|
<EM
|
|
>looks</EM
|
|
>, focus on the content.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="abiword"
|
|
></A
|
|
>B.2.1.1. AbiWord</H3
|
|
><P
|
|
> Through word of mouth I've heard that AbiWord can work (natively)
|
|
with DocBook documents. This will need to be tested by someone
|
|
(possibly me) and should definitely be included if it is
|
|
the case.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="openoffice"
|
|
></A
|
|
>B.2.1.2. OpenOffice.org</H3
|
|
><P
|
|
> <A
|
|
HREF="http://openoffice.org"
|
|
TARGET="_top"
|
|
>http://openoffice.org</A
|
|
>
|
|
</P
|
|
><P
|
|
> As of OpenOffice.org (OOo) 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 tagset 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://xml.openoffice.org/xmerge/docbook/supported_tag_table.html"
|
|
TARGET="_top"
|
|
>http://xml.openoffice.org/xmerge/docbook/supported_tag_table.html</A
|
|
>.
|
|
</P
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-ooo-1-0"
|
|
></A
|
|
>B.2.1.2.1. Open Office 1.0.x</H4
|
|
><P
|
|
> 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
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> These notes may not apply to the version of OOo you
|
|
are using.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
> 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
|
|
> 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"
|
|
> <?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">
|
|
</TT
|
|
>
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> The pull-down menu in the <SPAN
|
|
CLASS="guimenu"
|
|
>File</SPAN
|
|
>-><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
|
|
> 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"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-ooo-1-1"
|
|
></A
|
|
>B.2.1.2.2. Open Office 1.1</H4
|
|
><P
|
|
> <A
|
|
HREF="http://www.merlinmonroe.com"
|
|
TARGET="_top"
|
|
>Tabatha Marshall</A
|
|
>
|
|
offers the following additional information for OOo 1.1.
|
|
</P
|
|
><A
|
|
NAME="AEN1362"
|
|
></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
|
|
> 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
|
|
> 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
|
|
> 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
|
|
> 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
|
|
>-><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
|
|
> <SPAN
|
|
CLASS="guilabel"
|
|
>Doctype</SPAN
|
|
>
|
|
<TT
|
|
CLASS="userinput"
|
|
><B
|
|
>-//OASIS//DTD DocBook XML V4.2//EN</B
|
|
></TT
|
|
>
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> <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
|
|
> <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
|
|
> <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
|
|
> <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
|
|
> 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 &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
|
|
> 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
|
|
> To validate the document, I used <SPAN
|
|
CLASS="guimenu"
|
|
>Tools</SPAN
|
|
>-><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
|
|
> If you want to open a file to see the source instead of the processed
|
|
results, go to <SPAN
|
|
CLASS="guimenu"
|
|
>Tools</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>XML Filter
|
|
Settings</SPAN
|
|
>-><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
|
|
> 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
|
|
> 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="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="wordperfect"
|
|
></A
|
|
>B.2.1.3. WordPerfect 9 (Corel
|
|
Office 2000)</H3
|
|
><P
|
|
> <A
|
|
HREF="http://www.corel.com/"
|
|
TARGET="_top"
|
|
> http://www.corel.com/</A
|
|
>
|
|
</P
|
|
><P
|
|
> WordPerfect 9 for the MS Windows platform has
|
|
support for SGML and DocBook 3.0. WordPerfect 9 for Linux has
|
|
no SGML capabilities.
|
|
</P
|
|
><P
|
|
> If you are using WordPerfect on the Linux operating system, please
|
|
read: <A
|
|
HREF="http://en.tldp.org/FAQ/WordPerfect-Linux-FAQ/"
|
|
TARGET="_top"
|
|
>WordPerfect on
|
|
Linux FAQ</A
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="XMLmind"
|
|
></A
|
|
>B.2.1.4. XMLmind's XML editor</H3
|
|
><P
|
|
> <A
|
|
HREF="http://www.xmlmind.com/xmleditor/"
|
|
TARGET="_top"
|
|
>http://www.xmlmind.com/xmleditor/</A
|
|
>
|
|
</P
|
|
><P
|
|
> Although strictly speaking, it is not a word processor,
|
|
XMLmind's <SPAN
|
|
CLASS="application"
|
|
>XML editor</SPAN
|
|
> allows authors to concentrate
|
|
on the content, and not the markup. It has built in
|
|
spelling and conversion utilities which allow you to transform your
|
|
documents without having to install and configure an additional
|
|
processing tool such as jade. There is a free <SPAN
|
|
CLASS="QUOTE"
|
|
>"standard
|
|
edition"</SPAN
|
|
>, which is a simplified version of their
|
|
<SPAN
|
|
CLASS="QUOTE"
|
|
>"professional edition."</SPAN
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-conglomerate"
|
|
></A
|
|
>B.2.1.5. Conglomerate</H3
|
|
><P
|
|
><A
|
|
HREF="http://www.conglomerate.org"
|
|
TARGET="_top"
|
|
>http://www.conglomerate.org</A
|
|
></P
|
|
><P
|
|
>According to their web site, <SPAN
|
|
CLASS="QUOTE"
|
|
>"Conglomerate aims to be an XML editor that everyone can use. In particular, our primary goal is to create the ultimate editor for DocBook and similar formats. It aims to hide the jargon and complexity of XML and present the information in your documents in a way that makes sense."</SPAN
|
|
></P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-vex"
|
|
></A
|
|
>B.2.1.6. Vex: a visual editor for XML</H3
|
|
><P
|
|
><A
|
|
HREF="http://vex.sourceforge.net/"
|
|
TARGET="_top"
|
|
>http://vex.sourceforge.net/</A
|
|
></P
|
|
><P
|
|
>According to their web site, <SPAN
|
|
CLASS="QUOTE"
|
|
>"The visual part comes from the fact that Vex hides the raw XML tags from the user, providing instead a wordprocessor-like interface. Because of this, Vex is best suited for document-style XML documents such as XHTML and DocBook rather than data-style XML documents."</SPAN
|
|
></P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H2
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-text-editors"
|
|
></A
|
|
>B.2.2. Text Editors</H2
|
|
><DIV
|
|
CLASS="caution"
|
|
><P
|
|
></P
|
|
><TABLE
|
|
CLASS="caution"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="25"
|
|
ALIGN="CENTER"
|
|
VALIGN="TOP"
|
|
><IMG
|
|
SRC="../images/caution.gif"
|
|
HSPACE="5"
|
|
ALT="Caution"></TD
|
|
><TH
|
|
ALIGN="LEFT"
|
|
VALIGN="CENTER"
|
|
><B
|
|
>For advanced writers</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> The tools outlined in this section allow you to work with
|
|
the DocBook tags directly. If you are not comfortable
|
|
working with markup languages you may want to use a word
|
|
processor instead. Word processors that support DocBook
|
|
are described in <A
|
|
HREF="tools-edit.html#tools-word-processors"
|
|
>Section B.2.1</A
|
|
>.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><P
|
|
> If you are comfortable working with markup languages and
|
|
text editors, you'll probably want to customize your
|
|
current editor of choice to handle DocBook files. Below
|
|
are some of the more common text editors that can, with
|
|
some tweaking, handle DocBook files.
|
|
</P
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="psgml"
|
|
></A
|
|
>B.2.2.1. Emacs (PSGML)</H3
|
|
><P
|
|
> <A
|
|
HREF="http://www.lysator.liu.se/~lenst/about_psgml/"
|
|
TARGET="_top"
|
|
> http://www.lysator.liu.se/~lenst/about_psgml/
|
|
</A
|
|
>
|
|
</P
|
|
><P
|
|
><SPAN
|
|
CLASS="application"
|
|
>Emacs</SPAN
|
|
> has an SGML
|
|
writing mode called <SPAN
|
|
CLASS="application"
|
|
>psgml</SPAN
|
|
> that is a
|
|
major mode designed for editing SGML and XML documents. It
|
|
provides:
|
|
</P
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
> <SPAN
|
|
CLASS="QUOTE"
|
|
>"syntax highlighting"</SPAN
|
|
> or <SPAN
|
|
CLASS="QUOTE"
|
|
>"pretty
|
|
printing"</SPAN
|
|
> features that make the tags stand out
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> a way to insert tags other than typing them by hand
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> and the ability to validate your document while writing
|
|
</P
|
|
></LI
|
|
></UL
|
|
><P
|
|
> For users of Emacs, it's a great way to go.
|
|
PSGML works with DocBook, LinuxDoc and other DTDs equally well.
|
|
</P
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="emacs-psgml-install"
|
|
></A
|
|
>B.2.2.1.1. Verifying PSGML is Installed</H4
|
|
><P
|
|
>
|
|
If you have installed a recent distribution, you may
|
|
already have PSGML installed for use with Emacs. To check,
|
|
start Emacs and look for the PSGML documentation (<B
|
|
CLASS="keycap"
|
|
>C</B
|
|
>-<B
|
|
CLASS="keycap"
|
|
>h</B
|
|
><B
|
|
CLASS="keycap"
|
|
>i</B
|
|
><B
|
|
CLASS="keycap"
|
|
>m</B
|
|
><B
|
|
CLASS="keycap"
|
|
>psgml</B
|
|
>).
|
|
</P
|
|
><DIV
|
|
CLASS="tip"
|
|
><P
|
|
></P
|
|
><TABLE
|
|
CLASS="tip"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="25"
|
|
ALIGN="CENTER"
|
|
VALIGN="TOP"
|
|
><IMG
|
|
SRC="../images/tip.gif"
|
|
HSPACE="5"
|
|
ALT="Tip"></TD
|
|
><TH
|
|
ALIGN="LEFT"
|
|
VALIGN="CENTER"
|
|
><B
|
|
>Dependencies</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> If you don't have PSGML installed now might be a good
|
|
time to upgrade Emacs. The rest of these instructions
|
|
will assume you have PSGML installed.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="emacs-config"
|
|
></A
|
|
>B.2.2.1.2. Configuring Emacs for Use With PSGML</H4
|
|
><P
|
|
>
|
|
If you want GNU Emacs to enter PSGML mode when you open
|
|
an <TT
|
|
CLASS="filename"
|
|
>.xml</TT
|
|
> file, it
|
|
will need to be able to find the DocBook DTD files.
|
|
If your distribution already had PSGML set up for use
|
|
with GNU Emacs, you probably won't need to do anything.
|
|
</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
|
|
>Tuning Emacs</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
> For more information on how to configure Emacs, check out
|
|
.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><P
|
|
>
|
|
Once you've configured your system to use PSGML you will
|
|
need to override Emacs' default <EM
|
|
>sgml-mode</EM
|
|
> with the
|
|
<EM
|
|
>psgml-mode</EM
|
|
>. This can be done by configuring your
|
|
<TT
|
|
CLASS="filename"
|
|
>.emacs</TT
|
|
> file. After you've edited the
|
|
configuration file you will need to restart Emacs.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="emacs-new-file"
|
|
></A
|
|
>B.2.2.1.3. Creating New DocBook XML Files</H4
|
|
><P
|
|
> There are a number of steps to creating a new DocBook XML
|
|
file in Emacs.
|
|
</P
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
> Create a new file with an
|
|
<TT
|
|
CLASS="filename"
|
|
>xml</TT
|
|
>
|
|
extension.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> On the first line of the file enter the doctype for the
|
|
version of DocBook that you would like to use.
|
|
If you're not sure what a doctype is all about, check <A
|
|
HREF="dtd.html"
|
|
>Section B.5</A
|
|
>
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>
|
|
Enter
|
|
<B
|
|
CLASS="keycap"
|
|
>C</B
|
|
>-<B
|
|
CLASS="keycap"
|
|
>c</B
|
|
>
|
|
<B
|
|
CLASS="keycap"
|
|
>C</B
|
|
>-<B
|
|
CLASS="keycap"
|
|
>p</B
|
|
>.
|
|
|
|
If Emacs manages to parse your DTD, you will
|
|
see <TT
|
|
CLASS="computeroutput"
|
|
>Parsing prolog...done</TT
|
|
>
|
|
in the minibuffer.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Enter
|
|
<B
|
|
CLASS="keycap"
|
|
>C</B
|
|
>-<B
|
|
CLASS="keycap"
|
|
>c</B
|
|
>
|
|
<B
|
|
CLASS="keycap"
|
|
>C</B
|
|
>-<B
|
|
CLASS="keycap"
|
|
>e</B
|
|
>
|
|
<B
|
|
CLASS="keycap"
|
|
>Enter</B
|
|
>
|
|
|
|
to auto-magically insert the parent element for your
|
|
document. (New authors are typically writing
|
|
<TT
|
|
CLASS="sgmltag"
|
|
>article</TT
|
|
>s.)
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> If things are working correctly, you should see new tags
|
|
for the parent element for your document right after the
|
|
document type declaration. In other words you should now
|
|
see two extra tags:
|
|
<TT
|
|
CLASS="sgmltag"
|
|
><article></TT
|
|
>
|
|
and
|
|
<TT
|
|
CLASS="sgmltag"
|
|
></article></TT
|
|
>
|
|
in your document.
|
|
</P
|
|
></LI
|
|
></UL
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="emacs-spell"
|
|
></A
|
|
>B.2.2.1.4. Spell Checking in Emacs</H4
|
|
><P
|
|
> Emacs can be configured to use <SPAN
|
|
CLASS="application"
|
|
>aspell</SPAN
|
|
>
|
|
by adding the following to your <TT
|
|
CLASS="filename"
|
|
>~/.emacs</TT
|
|
> file.
|
|
Thanks to <A
|
|
HREF="http://www.ertius.org"
|
|
TARGET="_top"
|
|
>Rob Weir</A
|
|
> for
|
|
this configuration information.
|
|
</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> ;; Use aspell
|
|
(setq-default ispell-program-name "aspell")
|
|
;;Setup some dictionary languages
|
|
(setq ispell-dictionary "british")
|
|
(setq flyspell-default-dictionary "british")
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-epcEdit"
|
|
></A
|
|
>B.2.2.2. epcEdit</H3
|
|
><P
|
|
> <A
|
|
HREF="http://www.tksgml.de/"
|
|
TARGET="_top"
|
|
> http://www.tksgml.de</A
|
|
>
|
|
</P
|
|
><P
|
|
> The <SPAN
|
|
CLASS="application"
|
|
>epcEdit</SPAN
|
|
> program allows you to edit XML files.
|
|
It has the advantages of not needing to know <SPAN
|
|
CLASS="application"
|
|
>Emacs</SPAN
|
|
> or
|
|
<SPAN
|
|
CLASS="application"
|
|
>vi</SPAN
|
|
> before starting, and is cross-platform, working in both
|
|
Windows and Linux. This is a commercial application, and
|
|
pricing can be found at
|
|
<A
|
|
HREF="http://www.tksgml.de/pricing.html"
|
|
TARGET="_top"
|
|
> http://www.tksgml.de/pricing.html</A
|
|
>
|
|
</P
|
|
><P
|
|
> Along with visual editing, epcEdit will also validate
|
|
documents on loading, and on demand by using the <SPAN
|
|
CLASS="guimenu"
|
|
>Document</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>Validate</SPAN
|
|
>
|
|
command.</P
|
|
><DIV
|
|
CLASS="figure"
|
|
><A
|
|
NAME="AEN1567"
|
|
></A
|
|
><P
|
|
><B
|
|
>Figure B-1. epcEdit screen shot</B
|
|
></P
|
|
><DIV
|
|
CLASS="mediaobject"
|
|
><P
|
|
><IMG
|
|
SRC="sgeditscreenshot.jpg"></P
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-morphoneditor"
|
|
></A
|
|
>B.2.2.3. Morphon XML editor</H3
|
|
><P
|
|
> <A
|
|
HREF="http://www.morphon.com/xmleditor/index.shtml"
|
|
TARGET="_top"
|
|
> http://www.morphon.com/xmleditor/index.shtml</A
|
|
>
|
|
</P
|
|
><P
|
|
> This is a commercial application which is currently
|
|
available for free (with an optional user registration).
|
|
It is written in Java, allowing it to run on any platform
|
|
that has a Java Virtual Machine (that is, works in both
|
|
Windows and Linux).
|
|
</P
|
|
><P
|
|
> On the plus sides of <SPAN
|
|
CLASS="application"
|
|
>XMLEditor</SPAN
|
|
> is the left side of the
|
|
screen shows the hierarchy of the document (starting with Book
|
|
and so on). Selecting an item in the list brings you to that
|
|
part of the document so you can edit it. The right part of the
|
|
screen shows the text without any markup or tags being shown.
|
|
If you have external files as ELEMENTS (as the LDP Author Guide
|
|
does), <SPAN
|
|
CLASS="application"
|
|
>XMLEditor</SPAN
|
|
> will follow the links and load the files, so
|
|
you always work on the entire work. On the minus side of this,
|
|
you will get errors if a file is missing.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-nedit"
|
|
></A
|
|
>B.2.2.4. nedit</H3
|
|
><P
|
|
> <A
|
|
HREF="http://nedit.org"
|
|
TARGET="_top"
|
|
> http://nedit.org</A
|
|
>
|
|
</P
|
|
><P
|
|
> To be fair, <SPAN
|
|
CLASS="application"
|
|
>nedit</SPAN
|
|
> is more
|
|
for programmers, so it might seem a bit of overkill for new
|
|
users and especially non-programmers. All that aside, it's
|
|
extremely powerful, allowing for syntax highlighting. Unlike
|
|
<SPAN
|
|
CLASS="application"
|
|
>epcEdit</SPAN
|
|
>, <SPAN
|
|
CLASS="application"
|
|
>nedit</SPAN
|
|
> doesn't allow you to automatically insert tags
|
|
or automatically validate your code. However, it does allow
|
|
for shell commands to be run against the contents of the
|
|
window (as opposed to saving the file, then checking).
|
|
|
|
|
|
<DIV
|
|
CLASS="figure"
|
|
><A
|
|
NAME="AEN1598"
|
|
></A
|
|
><P
|
|
><B
|
|
>Figure B-2. nedit screen shot</B
|
|
></P
|
|
><DIV
|
|
CLASS="mediaobject"
|
|
><P
|
|
><IMG
|
|
SRC="neditscreenshot.jpg"></P
|
|
></DIV
|
|
></DIV
|
|
>
|
|
</P
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="usingnedit"
|
|
></A
|
|
>B.2.2.4.1. Using nedit</H4
|
|
><P
|
|
>When you open your DocBook file, <SPAN
|
|
CLASS="application"
|
|
>nedit</SPAN
|
|
> should already
|
|
have syntax highlighting enabled. If it does not you can
|
|
turn it on explicitly using:
|
|
<SPAN
|
|
CLASS="guimenu"
|
|
>Preferences</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>Language Mode</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>SGML HTML</SPAN
|
|
>
|
|
</P
|
|
><P
|
|
> If you have line numbers turned on (using
|
|
<SPAN
|
|
CLASS="guimenu"
|
|
>Preferences</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>Show
|
|
Line Numbers</SPAN
|
|
>) then finding
|
|
validation errors is much simpler.
|
|
<SPAN
|
|
CLASS="application"
|
|
>nsgmls</SPAN
|
|
>, the validation tool
|
|
we'll use, lists errors by their line number.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="nedit-scripting"
|
|
></A
|
|
>B.2.2.4.2. Configuring nedit</H4
|
|
><P
|
|
> Since you can feed the contents of your window to
|
|
outside programs, you can easily extend nedit to perform
|
|
repetitive functions. The example you'll see here is to
|
|
validate your document using
|
|
<SPAN
|
|
CLASS="application"
|
|
>nsgmls</SPAN
|
|
>.
|
|
For more information about <SPAN
|
|
CLASS="application"
|
|
>nsgmls</SPAN
|
|
> and validating
|
|
documents please read <A
|
|
HREF="tools-validate.html"
|
|
>Section B.3</A
|
|
>.
|
|
</P
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
> Select <SPAN
|
|
CLASS="guimenu"
|
|
>Preferences</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>Default
|
|
Settings</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>Customize
|
|
Menus</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>Shell
|
|
Menu...</SPAN
|
|
>. This will bring up the
|
|
Shell Command dialog box, with all the shell commands nedit
|
|
has listed under the
|
|
<SPAN
|
|
CLASS="guimenu"
|
|
>Shell</SPAN
|
|
> menu.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Under
|
|
Menu Entry, enter <SPAN
|
|
CLASS="QUOTE"
|
|
>"Validate DocBook."</SPAN
|
|
> This will be the entry
|
|
you'll see on the screen.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Under Accelerator, press
|
|
<B
|
|
CLASS="keycap"
|
|
>Alt</B
|
|
>-<B
|
|
CLASS="keycap"
|
|
>S</B
|
|
>.
|
|
Once this menu item is set up, you can press
|
|
<B
|
|
CLASS="keycap"
|
|
>Alt</B
|
|
>-<B
|
|
CLASS="keycap"
|
|
>S</B
|
|
>
|
|
to have the Validate DocBook automatically run.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Under Command
|
|
Input, select window, and under Command Output, select
|
|
dialog.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> Under Command to Execute, enter
|
|
<B
|
|
CLASS="command"
|
|
>nsgmls
|
|
<TT
|
|
CLASS="parameter"
|
|
><I
|
|
>-sv</I
|
|
></TT
|
|
></B
|
|
>. Using
|
|
<TT
|
|
CLASS="parameter"
|
|
><I
|
|
>-v</I
|
|
></TT
|
|
> outputs the version number
|
|
is output to the screen so that you know the command
|
|
has run.
|
|
</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 PATH</B
|
|
></TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
> </TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
><P
|
|
>Note
|
|
that <SPAN
|
|
CLASS="application"
|
|
>nsgmls</SPAN
|
|
> has to be in your
|
|
<TT
|
|
CLASS="envar"
|
|
>PATH</TT
|
|
> for this to work properly.
|
|
</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></LI
|
|
></UL
|
|
><DIV
|
|
CLASS="figure"
|
|
><A
|
|
NAME="AEN1659"
|
|
></A
|
|
><P
|
|
><B
|
|
>Figure B-3. Adding shell commands to nedit</B
|
|
></P
|
|
><DIV
|
|
CLASS="mediaobject"
|
|
><P
|
|
><IMG
|
|
SRC="neditshellcommand.jpg"></P
|
|
></DIV
|
|
></DIV
|
|
><P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
> Click <SPAN
|
|
CLASS="guibutton"
|
|
>OK</SPAN
|
|
> and you'll now be back
|
|
at the main nedit screen. Load up an XML file, and select
|
|
<SPAN
|
|
CLASS="guimenu"
|
|
>Shell</SPAN
|
|
>-><SPAN
|
|
CLASS="guimenuitem"
|
|
>Validate
|
|
DocBook</SPAN
|
|
> or press
|
|
<B
|
|
CLASS="keycap"
|
|
>Alt</B
|
|
>-<B
|
|
CLASS="keycap"
|
|
>S</B
|
|
>.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> The <B
|
|
CLASS="command"
|
|
>nedit</B
|
|
> program will fire up and check
|
|
the contents of the window.
|
|
</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
> If all you see is a version number for
|
|
<SPAN
|
|
CLASS="application"
|
|
>nsgml</SPAN
|
|
> then your
|
|
document is valid. Any errors are reported by line
|
|
number in your document.
|
|
</P
|
|
></LI
|
|
></UL
|
|
><DIV
|
|
CLASS="figure"
|
|
><A
|
|
NAME="AEN1682"
|
|
></A
|
|
><P
|
|
><B
|
|
>Figure B-4. <SPAN
|
|
CLASS="application"
|
|
>nsgmls</SPAN
|
|
> output on success</B
|
|
></P
|
|
><DIV
|
|
CLASS="mediaobject"
|
|
><P
|
|
><IMG
|
|
SRC="neditsuccess.jpg"></P
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-vim"
|
|
></A
|
|
>B.2.2.5. VIM</H3
|
|
><P
|
|
> <A
|
|
HREF="http://www.vim.org"
|
|
TARGET="_top"
|
|
>http://www.vim.org</A
|
|
>
|
|
</P
|
|
><P
|
|
> No mention of text editors is complete
|
|
without talking about <SPAN
|
|
CLASS="application"
|
|
>vi</SPAN
|
|
>.
|
|
The <SPAN
|
|
CLASS="application"
|
|
>VIM</SPAN
|
|
> (Vi IMproved)
|
|
editor has the functionality of
|
|
regular vi and includes <SPAN
|
|
CLASS="QUOTE"
|
|
>"syntax
|
|
highlighting"</SPAN
|
|
> of tags.</P
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="usingvim"
|
|
></A
|
|
>B.2.2.5.1. Getting Started</H4
|
|
><P
|
|
> There are many versions of <SPAN
|
|
CLASS="application"
|
|
>vi</SPAN
|
|
>.
|
|
New authors will likely want one of the more
|
|
feature-packed versions for syntax highlighting and
|
|
a graphical interface including mouse control.
|
|
</P
|
|
><P
|
|
> Red Hat users will want the following packages:
|
|
vim-common, vim-minimal and vim-enhanced.
|
|
Debian users will want the following package: vim.
|
|
For an X interface (including <SPAN
|
|
CLASS="acronym"
|
|
>GUI</SPAN
|
|
> menus and
|
|
mouse control) users will want
|
|
<SPAN
|
|
CLASS="application"
|
|
>gvim</SPAN
|
|
>. The <SPAN
|
|
CLASS="QUOTE"
|
|
>"g"</SPAN
|
|
> in gvim is for
|
|
<SPAN
|
|
CLASS="QUOTE"
|
|
>"Graphical"</SPAN
|
|
>.
|
|
</P
|
|
><P
|
|
><SPAN
|
|
CLASS="application"
|
|
>VIM</SPAN
|
|
> compiles very easy should you need to build your own. Both <B
|
|
CLASS="command"
|
|
>vim</B
|
|
> and <B
|
|
CLASS="command"
|
|
>gvim</B
|
|
> are built by default. Syntax highlighting is included but not enabled by default if you have to start from scratch; use the <B
|
|
CLASS="command"
|
|
>:syntax enable</B
|
|
> command in <SPAN
|
|
CLASS="application"
|
|
>VIM</SPAN
|
|
> to turn this feature on.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="vim-new-file"
|
|
></A
|
|
>B.2.2.5.2. Creating New DocBook XML Files</H4
|
|
><P
|
|
> In both <SPAN
|
|
CLASS="application"
|
|
>vim</SPAN
|
|
> and
|
|
<SPAN
|
|
CLASS="application"
|
|
>gvim</SPAN
|
|
>, <TT
|
|
CLASS="filename"
|
|
>.xml</TT
|
|
> files will be
|
|
recognized and enter into <SPAN
|
|
CLASS="QUOTE"
|
|
>"SGML mode"</SPAN
|
|
>.
|
|
A series of known DocBook tags and attributes have
|
|
been entered into <SPAN
|
|
CLASS="application"
|
|
>vim</SPAN
|
|
>
|
|
and will be highlighted one color if the name is known
|
|
and another if it is not (for this author the colors are yellow and blue).
|
|
</P
|
|
><P
|
|
> Having the
|
|
correct document type declaration at the top of your
|
|
document should add the syntax highlighting.
|
|
If you do not see this highlighting you will need to
|
|
force VIM into SGML mode (even for XML files) using the
|
|
command <B
|
|
CLASS="command"
|
|
>:set ft=sgml</B
|
|
>. If you are
|
|
working with multiple files for a single XML document you
|
|
can add your document type in <-- comments --> to
|
|
the top of the file to get the correct syntax
|
|
highlighting (you will need to restart the program to see
|
|
the change in highlighting). The top line of this file
|
|
(<TT
|
|
CLASS="filename"
|
|
>tools-text-editors.xml</TT
|
|
>) looks like this:
|
|
</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
>
|
|
<!-- <!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.2//EN'> -->
|
|
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="vim-spellcheck"
|
|
></A
|
|
>B.2.2.5.3. Spell Check</H4
|
|
><P
|
|
> As in <SPAN
|
|
CLASS="application"
|
|
>Emacs</SPAN
|
|
>,
|
|
<SPAN
|
|
CLASS="application"
|
|
>Vim</SPAN
|
|
>, will work quite happily with
|
|
<SPAN
|
|
CLASS="application"
|
|
>aspell</SPAN
|
|
>. It can be run from within Vim
|
|
with the following:
|
|
<TT
|
|
CLASS="userinput"
|
|
><B
|
|
>:! aspell -c %</B
|
|
></TT
|
|
>.
|
|
</P
|
|
><P
|
|
> For more sophisticated spell check alternatives, give <A
|
|
HREF="http://cream.sourceforge.net/"
|
|
TARGET="_top"
|
|
>Cream</A
|
|
> or <A
|
|
HREF="http://www.vim.org/scripts/script_search_results.php?keywords=vimspell&script_type=&order_by=rating&direction=descending&search=search"
|
|
TARGET="_top"
|
|
>vimspell</A
|
|
> a try.
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H4
|
|
CLASS="section"
|
|
><A
|
|
NAME="vim-tagcompletion"
|
|
></A
|
|
>B.2.2.5.4. Tag Completion</H4
|
|
><P
|
|
> The following information is provided by <A
|
|
HREF="http://www.digitalhermit.com"
|
|
TARGET="_top"
|
|
>Kwan Lowe</A
|
|
>.
|
|
</P
|
|
><P
|
|
> Vim has a DocBook helper script which can be easily copied into
|
|
your <TT
|
|
CLASS="filename"
|
|
>.vimscripts</TT
|
|
>
|
|
directory and used to <SPAN
|
|
CLASS="QUOTE"
|
|
>"auto complete"</SPAN
|
|
> tags while
|
|
writing DocBook documents. The script can be downloaded from:
|
|
<A
|
|
HREF="http://www.vim.org/scripts/script.php?script_id=38"
|
|
TARGET="_top"
|
|
>http://www.vim.org/scripts/script.php?script_id=38</A
|
|
>.
|
|
</P
|
|
><A
|
|
NAME="AEN1752"
|
|
></A
|
|
><BLOCKQUOTE
|
|
CLASS="BLOCKQUOTE"
|
|
><P
|
|
> Grab the file, then untar it. Copy the
|
|
<TT
|
|
CLASS="filename"
|
|
>dbhelper.vim</TT
|
|
> to your <TT
|
|
CLASS="filename"
|
|
>.vimscripts</TT
|
|
> directory if you have one.
|
|
</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> <TT
|
|
CLASS="prompt"
|
|
>$ </TT
|
|
><B
|
|
CLASS="command"
|
|
>mkdir</B
|
|
> <TT
|
|
CLASS="filename"
|
|
>.vimscripts</TT
|
|
>
|
|
<TT
|
|
CLASS="prompt"
|
|
>$ </TT
|
|
><B
|
|
CLASS="command"
|
|
>cp</B
|
|
> <TT
|
|
CLASS="filename"
|
|
>dbhelper.vim</TT
|
|
> <TT
|
|
CLASS="filename"
|
|
>.vimscripts</TT
|
|
>
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> You'll also have to convert the <TT
|
|
CLASS="filename"
|
|
>dbhelper.vim</TT
|
|
> file to unix formatting:
|
|
</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="screen"
|
|
> <TT
|
|
CLASS="prompt"
|
|
>$ </TT
|
|
><B
|
|
CLASS="command"
|
|
>dos2unix</B
|
|
> <TT
|
|
CLASS="filename"
|
|
>dbhelper.vim</TT
|
|
>
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
> Next, edit your <TT
|
|
CLASS="filename"
|
|
>.vimrc</TT
|
|
> file and add the line:
|
|
<TT
|
|
CLASS="userinput"
|
|
><B
|
|
>source
|
|
/home/yourname/.vimscripts/dbhelper.vim</B
|
|
></TT
|
|
>
|
|
</P
|
|
><P
|
|
> To use the scripts, enter vi and go into insert mode. Press
|
|
<B
|
|
CLASS="keycap"
|
|
>,</B
|
|
> (comma) followed by the shortcut. For example:
|
|
<TT
|
|
CLASS="userinput"
|
|
><B
|
|
>,dtbk</B
|
|
></TT
|
|
>
|
|
</P
|
|
></BLOCKQUOTE
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="xmlform"
|
|
></A
|
|
>B.2.2.6. XMLForm</H3
|
|
><P
|
|
><A
|
|
HREF="http://www.datamech.com/XMLForm/"
|
|
TARGET="_top"
|
|
>http://www.datamech.com/XMLForm/</A
|
|
></P
|
|
><P
|
|
>This web-based application allows you to put in the URL for XML source, or copy and paste the XML directly into the web form. The application then breaks down your document into a series of form fields that hide the DocBook tags so that you may edit the content directly. Version 5 is available from <A
|
|
HREF="http://www.datamech.com/XMLForm/formGenerator5.html"
|
|
TARGET="_top"
|
|
>http://www.datamech.com/XMLForm/formGenerator5.html</A
|
|
>. This application is best on shorter documents (less than 20 pages printed).</P
|
|
><P
|
|
>As this is an on-line tool, it will be good for small updates only.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="section"
|
|
><H3
|
|
CLASS="section"
|
|
><A
|
|
NAME="tools-xxe"
|
|
></A
|
|
>B.2.2.7. XMLmind XML Editor (XXE)</H3
|
|
><P
|
|
> <A
|
|
HREF="http://www.xmlmind.com/xmleditor"
|
|
TARGET="_top"
|
|
>http://www.xmlmind.com/xmleditor</A
|
|
>
|
|
</P
|
|
><P
|
|
> David Horton offers the following information:
|
|
</P
|
|
><A
|
|
NAME="AEN1788"
|
|
></A
|
|
><BLOCKQUOTE
|
|
CLASS="BLOCKQUOTE"
|
|
><P
|
|
> I am a big fan of XMLMind's <SPAN
|
|
CLASS="application"
|
|
>XXE</SPAN
|
|
> editor and <SPAN
|
|
CLASS="application"
|
|
>XFC</SPAN
|
|
> FO converter.
|
|
It is <SPAN
|
|
CLASS="QUOTE"
|
|
>"free as in beer,"</SPAN
|
|
> but not necessarily
|
|
<SPAN
|
|
CLASS="QUOTE"
|
|
>"free as in speech."</SPAN
|
|
> Very liberal license for personal use
|
|
however. It's Java-based so it works on all sorts of OS's.
|
|
</P
|
|
></BLOCKQUOTE
|
|
></DIV
|
|
></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="tools-distro.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="tools-validate.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Tools for your operating
|
|
system</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="tools.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Validation</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |