nxml and Fedora

Here is how you can work with emacs in nxml major mode in Fedora. nxml is a good alternative to psgml.

1. Check that docbook, especially docbook ver 5.0 is installed.

# yum list docbook*

2. If not install docbook packages as:

# yum install docbook*

3. Install nxml for emacs, as:

# yum install *nxml*

This will install emacs-nxml-mode and libnxml-devel packages.

4. Log on as some user in graphics mode in your Linux machine. In your
home folder an earlier .emacs file is possibly available. Rename it as, say,
.emacs.old. Start emacs now. Visit a new file (c-c c-f) and give it any
name but do give .xml extension. In the menu bar a new XML menu will appear.

5. Press c-c c-f to insert/write the following line in your buffer:

<?xml version=”1.0″ encoding=”utf-8″?>

6. Press c-c c-s c-w to show schema location (or,
XML->Show Schema Location).  You will get the message:Using vacuous
schema. Set schema file as: XML->Set Schema->File and in the File
Browser, point to file: /usr/share/xml/docbook5/schema/rng/5.0/docbook.rnc.
Note that nxml package also has a docbook.rnc file at:
/usr/share/emacs/site-lisp/nxml-mode/schema/docbook.rnc, but this is an
older version of docbook. Check again the schema as: c-c c-s c-w.
You will get the message:

Using schema /usr/share/xml/docbook5/schema/rng/5.0/docbook.rnc

This is OK.

7. Now below the first line (<?xml..>) tag, write just < and press,
c-RET (or ctrl+ENTER). You will get a number of options/tags.
Select one, say book.

8. Begin your work in docbook. Errors are displayed as red-underline and
on taking cursor over a red-underline, error message will be displayed in
the message buffer for taking  corrective action.

9. Have a relook at your .emacs.old file. Include those lines/lisp instructions
that you feel  are necessary.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: