This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] <programlisting> escape sequences and error: detected an error in element
- From: Sheldon Plankton <sheldonplankton at yahoo dot com>
- To: DocBook Apps <docbook-apps at lists dot oasis-open dot org>
- Date: Thu, 9 Sep 2004 15:29:11 -0700 (PDT)
- Subject: [docbook-apps] <programlisting> escape sequences and error: detected an error in element
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 :)
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail