As far as I can see, it's not a problem with your document. It's
well-formed XML and valid DocBook.
I tried running it through xsltproc, but couldn't reproduce those
errors -- it generates HTML without any problems -
http://docbook.sourceforge.net/tmp/example.html
Maybe it's the version of xsltproc you're using. Running
'xsltproc --version' on the machine where I tested says -
xsltproc was compiled against libxml 20604, libxslt 10102 and libexslt 802
So if 'xsltproc --version' on your machine tells you it's linking to a
libxml older than 20604, you might want to try installing the latest
libxml2/libxslt/xsltproc that you can find, and retry your test.
You might also try running it through another XSLT engine. Do you have
Saxon?
Sheldon Plankton <> writes:
> Hi,
>
> I am having problems with <programlisting> docbook tag
> I think. I want to list a shell script that makes use
> of escape sequences to do fancy color stuff on the
> terminal. Yes I know that's a bad idea ... but it
> ain't my script I just need to document it :)
>
> Here's is a short example of what I am doing ....
>
>
>
> bash-2.05b$ xsltproc -o example.html ../notes.xsl
> example.xml
> example.xml:18: error: detected an error in element
> content
> print "Enter your encryption password?n"
> ^
> example.xml:18: error: Premature end of data in tag
> programlisting
> print "Enter your encryption password?n"
> ^
> example.xml:18: error: detected an error in element
> content
> print "Enter your encryption password?n"
> ^
> example.xml:18: error: Premature end of data in tag
> para
> print "Enter your encryption password?n"
> ^
> example.xml:18: error: detected an error in element
> content
> print "Enter your encryption password?n"
> ^
> example.xml:18: error: Premature end of data in tag
> sect1
> print "Enter your encryption password?n"
> ^
> example.xml:18: error: detected an error in element
> content
> print "Enter your encryption password?n"
> ^
> example.xml:18: error: Premature end of data in tag
> article
> print "Enter your encryption password?n"
> ^
> example.xml:18: error: Extra content at the end of the
> document
> print "Enter your encryption password?n"
> ^
> unable to parse example.xml
>
> Here's what I have in example.xml ...
>
> <?xml version="1.0"?>
> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML
> V4.1.2//EN"
> "/usr/share/sgml/docbook/xml-dtd-4.2-1.0-17/docbookx.dtd">
> <article>
> <articleinfo>
> <title>Example</title>
> </articleinfo>
> <sect1> <title>Example</title> <para>
> <programlisting>
>
>
>
>
> WhichEncryptCipher () {
> #######################
> ENC_PROG_CIPHER=`cat /etc/recovery/EncryptedWith`
> if [ -z "${ENC_PROG_CIPHER}" ]; then
> ENC_PROG_PASSWD=""
> ENC_PROG="cat"
> else
> print "^[[1;33mEnter your encryption
> password^[[36m?n"
> stty -echo < `tty`
> read passwd < `tty`
> stty echo < `tty`
> #ENC_PROG_PASSWD="-pass pass:${passwd}"
> touch /tmp/.key
> chmod 600 /tmp/.key
> echo ${passwd} > /tmp/.key
> ENC_PROG_PASSWD="-kfile /tmp/.key"
> ENC_PROG="openssl"
> fi
> }
> #-----<--------->-------
> </programlisting>
> </para>
> </sect1>
> </article>
> bash-2.05b$
>
> Also the < are mine shouldn;t the programlisting
> tag be able to deal with <'s ???
>
> Thanks
> Sheldon :)