DocBook getting started (with xmlto in Redhat Linux)

D

Dr. Laurence Leff

I am having trouble doing the basics with xmlto on Redhat to convert
DocBook XML into the various files.

I believe the problem is the first line on the files:

Here is starter file (notes.xml):

<!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN">
<!ENTITY chap1 SYSTEM "chap1.xml">
<Book><title>CS310 notes</title></BOOK>
&chap1;

Here is the chap1.xml file:


<!DOCTYPE Chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN">
<Chapter id="ch1"><title>Binary Numbers and the Layers of Computer Organization</TITLE>
<para>
This course deals with several layers that are used to construct
all computers.
<orderedlist Numeration="Arabic">
<listitem>
At the top is a
... stuff deleted to save space ...
</Chapter>

Here is the results when I try xmlto.
I couldn't get xmlto pdf notes.xml to work either.

Thanks for helping me get started with docbook by telling me what
practical detail I neglected.

Dr. Laurence Leff Western Illinois University, Macomb IL 61455 ||(309) 298-1315
Stipes 447 Assoc. Prof. of Computer Sci. Pager: 309-367-0787 FAX: 309-298-2302
Secretary: The OASIS Legal XML Member Section Court Filing Technical Committee
and Electronic Contracts Technical Committee

__________________________________________________
sh-2.05b$ xmlto -v ps notes.xml
Format script: /usr/share/xmlto/format/docbook/ps
Convert to XSL-FO
Stylesheet: http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl
xsltproc --nonet --xinclude \
-o /tmp/xmlto.TFjwM6/notes.proc \
http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl \
/home/leff/310/notes.xml
/home/leff/310/notes.xml:1: error: Space required after the Public Identifier
<!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN">
^
/home/leff/310/notes.xml:1: error: SystemLiteral " or ' expected
<!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN">
^
/home/leff/310/notes.xml:1: error: xmlParseExternalID: PUBLIC, no URI
<!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN">
^
/home/leff/310/notes.xml:2: error: xmlParseStartTag: invalid element name
<!ENTITY chap1 SYSTEM "chap1.xml">
^
/home/leff/310/notes.xml:2: error: Extra content at the end of the document
<!ENTITY chap1 SYSTEM "chap1.xml">
 
B

Bob Foster

Neither of the quoted fragments come from well-formed XML files. In an XML
file, a system identifier is required, e.g., in the doctype declarations
where you have only public identifiers. Element names are case-sensitive.
"<book>" not "<Book>". "</book>" not "</BOOK>". "</title>" not "</TITLE>".
Looks like you have some fixing to do before you can start to have problems
with XSLT.

Bob Foster
 
D

Dr. Laurence Leff

As I wrote earlier, I am having trouble doing the basics with xmlto on Redhat
to convert DocBook XML into the various files.

I believe I fixed the problem with my DOCTYPE lines. They now read as follows:

NOTES.XML:


<!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY chap1 SYSTEM "chap1.xml">
]>
<Book><title>CS310 notes</title>
&chap1;
</Book>

chap1.xml:


<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<chapter id="ch1"><title>Binary Numbers and the Layers of Computer Organization</title>
<para>
This course deals with several layers that are used to construct
all computers.
<orderedlist Numeration="Arabic">
<listitem>
At the top is a
*** - stuff deleted to save space ---
</listitem>
</orderedlist>
</chapter>



)))))))))))))))))))))))))))))))))
Now, I just have trouble with the beginning of the included file.
Here is my error message.

Convert to XSL-FO
/home/leff/310/chap1.xml:1: error: xmlParseStartTag: invalid element name
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis
^
 
C

Christopher Cooper

In the future, try: http://lists.oasis-open.org/archives/docbook-apps/

I don't think you will get xmlto to work, because you don't have a valid
a valid XML document.

This is what I whipped up, using your info:

<?xml version='1.0' ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY chap1 SYSTEM "chap1.xml">
]>
<book>
<bookinfo>
<title>CS310 notes</title>
</bookinfo>

&chap1;
</book>


//---------------------------------------------------------------------------//

<?xml version='1.0' ?>
<chapter id="ch1">
<title>Binary Numbers and the Layers of Computer Organization</title>
<para>This course deals with several layers that are used to construct
all computers.</para>

<itemizedlist>
<listitem>
<indexterm>
<primary>At the top is a</primary>
</indexterm>

<indexterm>
<primary> ... stuff deleted to save space ...</primary>
</indexterm>
</listitem>
</itemizedlist>
</chapter>


I hope this works for you and good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top