DocBook getting started (with xmlto in Redhat Linux)

Discussion in 'XML' started by Dr. Laurence Leff, Aug 17, 2003.

  1. 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">
     
    Dr. Laurence Leff, Aug 17, 2003
    #1
    1. Advertising

  2. Dr. Laurence Leff

    Bob Foster Guest

    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" <> wrote in message
    news:bhoejq$i93$...
    > 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, Aug 17, 2003
    #2
    1. Advertising

  3. 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
    ^
     
    Dr. Laurence Leff, Aug 17, 2003
    #3
  4. 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!

    Dr. Laurence Leff wrote:
    > 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, Aug 17, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. U. George
    Replies:
    4
    Views:
    880
    U. George
    Aug 11, 2005
  2. Dr. Laurence Leff

    DocBook Simple Table Problem (using xmlto)

    Dr. Laurence Leff, Sep 4, 2003, in forum: XML
    Replies:
    0
    Views:
    436
    Dr. Laurence Leff
    Sep 4, 2003
  3. Antonio Amato
    Replies:
    2
    Views:
    1,331
    Michael Wiedmann
    Nov 18, 2004
  4. Jim Anderson
    Replies:
    12
    Views:
    688
    Joe Kesselman
    Feb 15, 2006
  5. Replies:
    1
    Views:
    544
    Joseph Kesselman
    Nov 27, 2007
Loading...

Share This Page