Creating a Docbook document with LyX is exactly the same as for any other kind of document: create a new file and select the Docbook layout you wish (Layout->Document->Class->DocBook {article, book, chaper, section} SGML).
Now, write the document (it should take more time ;-).
Publishing/exporting a document
The document can be exported to SGML, DVI, PostScript, text and HMTL, by using File->Export as.
Publishing to DVI or to PostScript creates in the directory where the source document is a .dvi or .ps file. LyX does the following operations to produce the exported file:
The document is translated to a temporary SGML file,
A temporary tex file is build by running sgmltools on the SGML temporary file, with tex for backend,
The DVI file is build by running jadetex on the temporary tex file,
The PostScript file is build by running dvips on the DVI file.
Exporting to HTML creates a directory whose name is the file name to export. This directory contains the output HTML files. There is one HTML file by chapter or section.
Publishing a document by hand
Publishing by hand allows you to choose stylesheets or backend not supported by default in LyX. Besides, it is a good exercise to learn how the tools work and to check independently from LyX that everything is well configured. To do this you just need to:
The publishing examples in the following sections are given only to show how it works. In fact all of these conversions are possible by using LyX directly.
sgmltools -b dvi mydoc.sgml
sgmltools -b html mydoc.sgml
jade -t tex -d /usr/lib/sgml/stylesheets/nwalsh-modular/print/docbook.dsl mydoc.sgml
jadetex mydoc.tex
jade -t sgml -d /usr/lib/sgml/stylesheets/nwalsh-modular/html/docbook.dsl mydoc.sgml