DocBook getting started (with xmlto in Redhat Linux)

Dr. Laurence Leff

Usenet Archive
Joined
Jul 22, 2001
Messages
10
Reaction score
0
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">
 

Bob Foster

Usenet Archive
Joined
Aug 14, 2002
Messages
220
Reaction score
0
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
 

Dr. Laurence Leff

Usenet Archive
Joined
Jul 22, 2001
Messages
10
Reaction score
0
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 ^
 

Christopher Cooper

Usenet Archive
Joined
Jul 27, 2003
Messages
2
Reaction score
0
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!
 

Georg Bauhaus

Usenet Archive
Joined
Jan 24, 2002
Messages
91
Reaction score
0
Dr. Laurence Leff wrote:
<!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>

I think a problem is that you declare another document type in an instance document (contained in chap1.xml) by including it via an entity reference.

: <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

This is the declaration which now is part of the Book instance.

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 ^

I don't know xmlto but it might give this message because it parses "!DOCTYPE" as an element name (as it is in the middle of parsing a document instance) and "!" is not a valid name start character.

HTH
Georg
 

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

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top